关于 Missing contentDescription attribute on image 警告的问题解决
来源:互联网 发布:图片定制软件 编辑:程序博客网 时间:2024/06/13 21:45
1、今天使用了下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
告,虽说可以不理 但总是感觉怪怪的,在网上一搜 发现原来这是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.
2、关于contentDescription这个属性的用法:
在android控件中有一个属性叫做android:contentDescription 。
一般来说,用户很少使用这个属性。
但是对于一些视力有障碍的用户,android提供给用户一个很有用的功能,可以帮助使用app。
这个属性必须在用户的Accessible 中的相应属性开启后才能使用。
(1). 首先下载google的应用 TalkBack (an accessibility service published by Google) 并且将功能打开 Settings > Accessibility >
TalkBack 设置为On。
(2).在应用中添加这个属性。
[html] view plaincopy在CODE上查看代码片派生到我的代码片
<Button
android:id=”@+id/pause_button”
android:src=”@drawable/pause”
android:contentDescription=”@string/pause”/>
(3).由于这个控件没有text属性,对于一些用户来说,无法理解这个控件是做什么的。
这时用户点击这个控件。android系统会自动使用人声朗读控件上android:contentDescription属性说指向的内容。
这样用户就可以知道这个控件是做什么用的。
这个属性的主要功能就是为视力有障碍的人增加对控件的解释。
总结的不好,还请多多指教……
0 0
- 关于 Missing contentDescription attribute on image 警告的问题解决
- 关于警告[Accessibility] Missing contentDescription attribute on image的解决方法
- 关于Android的Missing contentDescription attribute on image
- 出现警告:[Accessibility] Missing contentDescription attribute on image
- ImageView出现警告[Accessibility]Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- Missing contentDescription attribute on image
- 使用ImageView引起Missing contentDescription attribute on image的问题
- LeetCode141之Linked List Cycle java题解
- swift写一个简单的列表unable to dequeue a cell with identifier reuseIdentifier - must register a nib or a cla
- mysql表ID自动增长
- Ubuntu手机开发者创新大赛-西安站-6月3日 周三07:00-10:30 西安邮电大学长安校区东区fz118
- 逻辑回归
- 关于 Missing contentDescription attribute on image 警告的问题解决
- 浅谈Android五大布局(二)——RelativeLayout和TableLayout
- 对泛型、反射的理解
- 黑马程序员——[OC]核心语法2
- 搜罗一些推荐的书 (一 )
- hive与hadoop、spark集成方案实践
- Python2.6-原理之类和oop(下)
- 【C++学习】构造函数、拷贝构造函数、析构函数小结
- Myeclipse使用技巧