18

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" />
Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
Salman Amjad
  • 1,545
  • 4
  • 13
  • 11
  • http://stackoverflow.com/questions/9730673/missing-contentdescription-attribute-on-image-in-xml – PhatHV Sep 12 '12 at 06:39

4 Answers4

28

In Eclipse

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

OR

add android:contentDescription in ImageView.

Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
  • by ignorng descritption nw i m getng ths warning Possible overdraw: Root element paints background @drawable/temperature with a theme that also paints a background (inferred theme is @android:style/Theme)... on xml widget... android:background="@drawable/temperature"> – Salman Amjad Jul 03 '12 at 06:25
4

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

Community
  • 1
  • 1
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • by ignorng descritption nw i m getng ths warning Possible overdraw: Root element paints background @drawable/temperature with a theme that also paints a background (inferred theme is @android:style/Theme)... on xml widget... android:background="@drawable/temperature"> – Salman Amjad Jul 03 '12 at 06:36
  • see this post http://stackoverflow.com/questions/9195762/possible-overdraw-root-element-paints-background – ρяσѕρєя K Jul 03 '12 at 06:39
3

Type in ImageView

android:contentDescription="TODO"
1

Just add this:

android:contentDescription="@string/description"

then go to yours Strings.xml and add this:

<string name="description"> YOUR_DESCRIPTION_HERE </string>
Cho Hee
  • 165
  • 1
  • 11