今天使用了下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.
转自http://blog.csdn.net/hn307165411/article/details/7179317
分享到:
相关推荐
这个vbs脚本是通过指定项目文件目录,自动搜寻下面所有的layout目录,找到所有的布局文件,将布局文件中的每个元素都加上contentDescription属性,以便uiautomator进行对象识别和引用操作。
一个Android开发集成科大讯飞语音识别+语音合成功能的小Demo
4. AimsiEnglish.apk:Aimsi编译的,button的text和contentdescription都是英文的; 5. AimsiHanzi.apk: Aimsi编译的,button的text和contentdescription都是汉字的; 6. AndroidContactsTest.java:官网上下载的,...
android:contentDescription="@string/app_name" /> java源码: mvImage.setSrcPath(filePath); mvImage.clear(); mvImage.setEffect(Effect.BLUR); mvImage.setMosaicColor(0xFF4D4D4D); mvImage.setMode...
可以通过自动化工具检查某些良好做法,例如,视图是否具有contentDescription。 其他规则需要人工判断,例如contentDescription是否对所有用户有意义。 有关移动辅助功能的更多信息,请参见: : 该库收集对View对象...
android:contentDescription 设置View的备注说明,作为一种辅助功能提供,为一些没有文字描述的View提供说明,如ImageButton。这里在界面上不会有效果,自己在程序中控制,可临时放一点字符串数据。 android:...
+(void)shareMultimediaToPlatformType:(UMSocialPlatformType)platformType ShareContentType:(ShareContentType)ShareContentType title:(NSString *)title contentDescription:(NSString *)contentDescription ...
exerciseJetpackCompose JetpackCompose注意 setContent:定义布局布局 撰写版本:1.0.0-alpha...* contentDescription 修饰符 结盟 contentScale α colorFilter 为必要之参数 垫片 参数 说明 *修饰符 垫片 修饰符
状态中心Tipstat Android开发人员招聘挑战... 去做: 辅助功能,需要为ImageViews设置ContentDescription。 编写完整的测试套件。 修复设计。 更多排序功能。 参考 :Stackoverflow的ListView的卡布局设计。 屏幕截图:
Android lint工具是Android studio中集成的一个代码提示工具,它主要负责对你的代码进行优化提示,包括xml和java文件,很...代码提示我们在6行需要为ImageView添加ContentDescription属性,突然感觉好强大。 其实我们
ShowCaseAndroid android 应用程序的自动化“ShowCase”和“Tips Baloons” 已知的问题 contentDescription 属性,在 PreferenceScreen' xml 中定义,被 android 忽略,因此只有 xml 定义的提示有效
应用程序使用以下命令支持可访问性:“ contentDescription”用于静态和动态元素,“ hint”用于静态和动态元素以指示每个元素的用途,在标记用作其他View对象内容标签的View对象时使用“ labelFor”属性。...
所以这只是一个声明。 我不知道这实际上是否可行。 问题与Android Espresso有关。 对于Espresso的高手来说,您知道我们没有任何方法可以通过espreso访问contentDescription。 对? 所以有什么办法可以让Element让...
android:contentDescription="@string/nav_desc" android:scaleType="matrix" /> android:id="@+id/sayit_viewPager" android:layout_width="wrap_content" android:layout_height="wrap_content" ...