Android add placeholder text to EditText

后端 未结 8 877
感动是毒
感动是毒 2020-12-02 04:34

How can I add a placeholder text to EditText in the class that isn\'t in the XML?

I have the following EditText in my code which will be sh

8条回答
  •  执念已碎
    2020-12-02 05:11

    In Android Studio you can add Hint (Place holder) through GUI. First select EditText field on designer view. Then Click on Component Tree Left side of IDE (Normally it's there, but it may be there minimized) There you can see Properties of selected EditText. Find Hint field as below Image

    There you can add Hint(Place holder) to EditText

提交回复
热议问题