转载自http://blog.csdn.net/hn307165411/article/details/7179317

今天使用了下ADT 16.0 在定义一个ImageVIew的时候 总是提示这个[Accessibility] Missing contentDescription attribute on image警告,虽说可以不理 但总是感觉怪怪的,在网上一搜 发现原来这是ADT 16.0的新特性,在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你定义一个android:contentDescription属性,用来描述这个控件的作用。英文原文如下,如有翻译的不对的地方,敬请批评指正。

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(安卓)使用Notification自定义通知栏显示
  2. ExpandableListView的使用
  3. 随笔--android中修改SeekBar控件默认显示
  4. android:activity销毁后,fragment使用控件,空指针
  5. Android属性动画与自定义属性动画
  6. Android(安卓)Studio 自定义设置注释模板——诺诺"涂鸦"记忆
  7. (4.2.4)【android开源组件】Android(安卓)省市县 三级联动(android-
  8. android自定义camera以及uri和文件路径之间的转换
  9. 替代CardView实现圆角图的第三方控件

随机推荐

  1. Google Protocol Buffer
  2. Android仿IOS提示框
  3. Android(安卓)Kotlin项目集成阿里ARouter
  4. Android(安卓)OOM Adjustments
  5. Android(安卓)自动化测试框架-百度cafe
  6. Android自学——ListView
  7. android之MediaPlay播放视频
  8. Android(安卓)解屏幕锁与点亮屏幕(来电时
  9. android binder机制之三 Server Porxy
  10. 在Linux下编译Windows版本的adb和fastboo