Android的皮棉contentDescription警告 [英] Android Lint contentDescription warning

查看:135
本文介绍了Android的皮棉contentDescription警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到的警告, [辅助]上的图像丢失contentDescription属性的ImageView的。同时采用了android皮棉

I am getting warning as "[Accessibility] Missing contentDescription attribute on image" for imageview. while using android lint

这是什么意思?

推荐答案

通过设置属性解决了这个警告安卓contentDescription 我的ImageView的

Resolved this warning by setting attribute android:contentDescription for my ImageView

android:contentDescription="@string/desc"

Android的皮棉支持ADT 16抛出这样的警告,以确保图像小部件提供contentDescription。

Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription.

这定义文本简要介绍了视图的内容。此属性主要用于辅助功能。由于某些观点不具备文字重presentation这个属性可以用来提供这样的。

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.

非文本的小部件一样ImageViews和ImageButtons应该使用contentDescription属性来指定窗口小部件的文字描述,使屏幕阅读器等辅助工具可以充分说明了用户界面。

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.

这篇关于Android的皮棉contentDescription警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆