Missing accessibility label: where
minSdk < 17
, you should provide anandroid:hint
Editable text fields should provide anandroid:hint
or, provided your minSdkVersion is at least 17, they may be referenced by a view with aandroid:labelFor
attribute. When usingandroid:labelFor
, be sure to provide anandroid:text
or anandroid:contentDescription
. If your view is labeled but by a label in a different layout which includes this one, just suppress this warning from lint.Issue id: LabelFor
How can fix this warning?
When using an ImageView , ImageButton , CheckBox , or other View that conveys information graphically, use an android:contentDescription attribute to provide a content label for that View . A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time.
To label an editable TextView or EditText , use android:hint to display a descriptive text label within the item when it's empty. If an app's user interface already provides a text label for the editable item, define android:labelFor on the labeling View to indicate which item the label describes.
A succinct label in a localized string that identifies the accessibility element.
Turn on TalkBackNavigate to Accessibility and select TalkBack. At the top of the TalkBack screen, press On/Off to turn on TalkBack.
Just add
tools:ignore="LabelFor"
in your xml.
I had I same problem. I fix it like this
Use @String/example for name your method Follow these steps
Go to Res>Values>Stings.xmladd a string like this
Enter Number 1
@String/Enter_Number_1
if required asking of hind just add this code with your hint
android:autofillHints=""
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