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" />
In Eclipse
Window->prefrences->Android->Lint Error Checking->Issues-> Accessibility->Content Decription->Severty select Ignore.
OR
add android:contentDescription
in ImageView.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With