Difference between android:id and android:labelFor?

后端 未结 5 648
春和景丽
春和景丽 2020-12-25 10:37

I wrote a simple layout which has an EditText, but it\'s showing the following warning message:

“No label views point to this text field”

5条回答
  •  青春惊慌失措
    2020-12-25 11:11

    The labelFor is an attribute for accessibility options. You assign this to a label so that if, on a form , user clicks a EditText field , android can know what to read (TalkBack for low vision users) to user.

    The id Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById().

提交回复
热议问题