android - 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" />
you can use layout editor's tools
or set android:contentdescription
null
.
here's example:
// don't need framelayout, // tell layout editor "ignore" in layout's parent <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:ignore="contentdescription" > <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" /> </framelayout>
<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:contentdescription="@null" android:src="@drawable/arrows" />
but better should consider adding short string
accurately describe imageview
for.
defines text briefly describes content of view. property used accessibility. since views not have textual representation attribute can used providing such.
must string value, using '\;' escape characters such '\n' or '\uxxxx' unicode character.
Comments
Post a Comment