Android ImageView :Missing contentDescription attribute on image

ADT 16.0 always prompts this [Accessibility] Missing contentDescription attribute on image warning when defining an ImageVIew . Although it can be ignored, it always feels weird. After a search on the Internet, I found that this is a new feature of ADT 16.0. In controls without text display, such as imageView and imageButton, ADT will prompt you to define an android:contentDescription attribute to describe the function of the control. The original English text is as follows

 

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326907577&siteId=291194637