转载自http://stackoverflow.com/questions/8500544/android-lint-contentdescription-warning


在使用ADT 16开发android程序时会发现在XML文件中定义ImageView总是会提示Warning:Missing content Description attribute on image的警告

我们可以使用添加android:contentDescription="@string/desc"的方式来解决这个问题,

具体解释参考下面的描述:

Resolved this warning by setting attribute android:contentDescription for my ImageView

android:contentDescription="@string/desc"

Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription

This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.


更多相关文章

  1. Android 自定义RadioButton或CheckBox选择样式
  2. 如何在Android平台上创建自定义的Cordova插件并使用SAP UI5消费
  3. 关于android中的宏定义查找
  4. 【Android】自定义控件系列之TextView设置Drawable的大小
  5. android 自定义dialog去掉白色背景
  6. Android增加自定义监听事件
  7. Android 自定义日期和时间和星期的弹窗
  8. Android studio自定义变量
  9. Android Seek自定义样式

随机推荐

  1. Android(安卓)AutoCompleteTextView的使
  2. Android(安卓)studio 2.0集成NDK
  3. android 自定义照相机Camera黑屏
  4. 使用 Android(安卓)Studio 搭建安卓开发
  5. Android(安卓)studio新建项目之后由于gra
  6. osg for android 学习之纹理丢失解决
  7. Android写入内部存储和sd卡
  8. Android(安卓)常见分辨率(mdpi、hdpi 、xh
  9. android5.1-在系统设置里添加设置选项 以
  10. Android应用程序访问远程数据库(mysql) i