在EditText中输入文本,然后当用户在其中单击时消失

Raj*_*Raj 13 android

如果有人能解释是否可以在EditText中输入文本,我将非常感激.(这将完成 android:text="")

但是当用户在其中单击时,文本将消失.

谢谢

Jon*_*oth 38

这可以通过使用提示来完成:

android:hint="the text you want"
Run Code Online (Sandbox Code Playgroud)


Her*_*ter 7

使用android:hint=""属性..单击edittext时将删除该属性

编辑:我太晚了:)