layout中的xml文件提示Missing contentDescription attribute on image
2015-10-22 11:43
363 查看
(2012-11-14 16:00:42)
使用ADT
16.0或者以上版本时,用户定义一个ImageView,会提示[Accessibility] Missing contentDescription attribute on image,虽说这个警告可以忽略不计,但总让人感觉不舒服。
其实,这是ADT
16.0的新特性,在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你添加一个android:contentDescription属性,用来描述这个控件的作用。(而且值引用strings.xml文件中的,否则又会有提示。)
英文原文如下:
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.
使用ADT
16.0或者以上版本时,用户定义一个ImageView,会提示[Accessibility] Missing contentDescription attribute on image,虽说这个警告可以忽略不计,但总让人感觉不舒服。
其实,这是ADT
16.0的新特性,在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你添加一个android:contentDescription属性,用来描述这个控件的作用。(而且值引用strings.xml文件中的,否则又会有提示。)
英文原文如下:
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.
相关文章推荐
- java配置环境变量
- DOM 中的文档节点,元素节点,属性节点,文本节点,注释节点
- Android SDK开发包国内下载地址
- 使用正则将身份证等敏感信息替换为*号
- 日志输出The application may be doing too much work on its main thread.
- 云计算发展的几个阶段
- 使用 ItextSharp HTML生成Pdf(C#)
- 解决Unsupported major.minor version 51.0错误
- linux下批量替换文件夹下某个字符串
- HDU 4956 Poor Hanamichi(BestCoder Round #5)
- laravel 查看SQL语句
- 高通平台mipi panel kernel读包方法
- Struts2三种动态方法调用
- 右值引用C++11
- 数组:Remove Element&Merge Sorted Array&First Missing Positive
- 5.数据结构之通用动态数组
- IDEA十大快捷键
- leetcode Pattern
- 简单Android代码混淆(转)
- Matlab之M程序与M函数