Skip to content Skip to sidebar Skip to footer

Accessibility Missing Contentdescription Attribute On Image How To Remove This Warning?

Accessibility] Missing contentDescription attribute on image

Solution 1:

In Eclipse

Window->prefrences->Android->Lint Error Checking->Issues-> Accessibility->Content Decription->Severty select Ignore.

OR

add android:contentDescription in ImageView.

Solution 2:

Lint support in ADT 16 and above throws this warning

Now question is why this is needed.

Consider scenario where you have designed application which have ImageView with some image.The image carries message what it does.But there may be a blind person who can not see.So in that case if you have used contentDescription attribute then Text-To-Speech functionality will read the value so even blind person will come to for what purpose image is placed there even though he can't see it.

contentDescription 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.

Widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers Text-To-Speech and other accessibility tools can adequately describe the user interface.

Solution 3:

try by adding android:contentDescription for ImageView

<ImageView
            android:id="@+id/imageView1"
            android:layout_width="34dp"
            android:layout_height="61dp"
            android:layout_marginLeft="11dp"
            android:layout_marginRight="0dp"
            android:contentDescription="@string/desc"
            android:layout_marginTop="11dp"
            android:background="#ff3333"
            android:src="@drawable/arrows" />

for more info see

http://android-developers.blogspot.in/2012/04/accessibility-are-you-serving-all-your.html

http://developer.android.com/guide/topics/ui/accessibility/apps.html#test

Android Lint contentDescription warning

Solution 4:

Type in ImageView

android:contentDescription="TODO"

Solution 5:

Just add this:

android:contentDescription="@string/description"

then go to yours Strings.xml and add this:

<string name="description"> YOUR_DESCRIPTION_HERE </string>

Post a Comment for "Accessibility Missing Contentdescription Attribute On Image How To Remove This Warning?"