Android add placeholder text to EditText

后端 未结 8 878
感动是毒
感动是毒 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 04:53

    android:hint="text" provides an info for user that what he need to fill in particular editText

    for example :- i have two edittext one for numeric value and other for string value . we can set a hint for user so he can understand that what value he needs to give

    android:hint="Please enter phone number"
    android:hint="Enter name" 
    

    after running app these two edittext will show the entered hint ,after click on edit text it goes and user can enter what he want (see luxurymode image)

提交回复
热议问题