关于xml中使用ImageView或ImageButton引起Missing contentDescription attribute on image 的问题
16lz
2021-01-26
在main.xml(或其他xml)中增加ImageView控件或ImageButton控件时如果没有加android:contentDescription="@string/app_name"时会引起Missing contentDescription attribute on image ,主要是因为在main.xml中没有使用TextView之类的文本控件,ADT会提示给像ImageView增加一个说明,这里添加android:contentDescription="@string/app_name即可,其实加不加影响不大。只是在IDE中会显示一个黄色下划线,不美观。
更多相关文章
- android自定义控件宽高的获取
- Android中利用LinearLayout动态添加控件
- Android的layout_weight属性详解
- Android(安卓)UI设计——AutoCompleteTextView
- Android(安卓)EditText 下换线颜色变换
- Android的ListView简单使用的实例(附Demo)
- Android(安卓)解决输入法遮挡布局控件的问题
- 一行代码实现Android右滑返回
- Android布局之二——Relative Layout