转载自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 可执行程序终于可以在nxp8473--cortex-a9平台运行
  2. Android(安卓)自定义RadioButton或CheckBox选择样式
  3. Android(安卓)NDK 开发教程三:Hello JNI 示例
  4. Android(安卓)studio自定义变量
  5. Android(安卓)自定义日期和时间和星期的弹窗
  6. Android增加自定义监听事件
  7. 【Android】自定义控件系列之TextView设置Drawable的大小
  8. Android之TabHost
  9. 如何在Android平台上创建自定义的Cordova插件并使用SAP UI5消费

随机推荐

  1. ANDROID – 使用特定的URL开启应用程序
  2. android中-----JSON例子一、 二
  3. Unable to execute dex: Multiple dex fi
  4. Android 异步获取网络图片并处理图片Out
  5. 16 个Android 开发者必备工具资源
  6. Android高德地图获取当前地理位置(不显示
  7. 自定义主题
  8. 常用的android开发网站
  9. Android(安卓)studio 3 gradle配置问题
  10. Android ListView组件中android:drawSele