What is android:contentDescription="@string/desc" in ImageView's xml?

Viewed 33259

I added an imageView in GraphicalLayout but it looks different on my real device than on AVD.

I found that I need to add contentDescription in a layout .xml, but when I add: contentDescription="@string/desc"

there is an error:

"No resource found that matches the given name (at 'contentDescription' with value '@string/desc')"

What is this string "desc"? What should it looks like?

5 Answers

Instead of using Content description and string description just use tools:ignore="ContentDescription" on your image view

public void setContentDescription (CharSequence contentDescription) Defines text that briefly describes content of the view.

A content description briefly describes the view and is primarily used for accessibility support to determine how a view should be presented to the user. In the case of a view with no textual representation, such as ImageButton, a useful content description explains what the view does. For example, an image button with a phone icon that is used to place a call may use "Call" as its content description. An image of a floppy disk that is used to save a file may use "Save".

Related