Salman Amjad
Salman Amjad

Reputation: 1555

Accessibility Missing contentDescription attribute on image how to remove this warning?

Accessibility] Missing contentDescription attribute on image

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

Upvotes: 18

Views: 38055

Answers (4)

Cho Hee
Cho Hee

Reputation: 165

Just add this:

android:contentDescription="@string/description"

then go to yours Strings.xml and add this:

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

Upvotes: 1

Yunus Se&#231;gin
Yunus Se&#231;gin

Reputation: 47

Type in ImageView

android:contentDescription="TODO"

Upvotes: 3

Samir Mangroliya
Samir Mangroliya

Reputation: 40416

In Eclipse

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

OR

add android:contentDescription in ImageView.

Upvotes: 28

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132992

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

Upvotes: 4

Related Questions