How to create tooltips in the text box editing window that go away when the focus of the text?

How should I do it? For example, when I create a stackoverflow question, the Title text box has this in the TextView edit box:

what's your programming question? to be specific.

As soon as you enter it or begin to enter it, it disappears. How do you do this for android? thank,

+3
source share
3 answers

In the Activity XML activity, specify

android: hint = "Your message"

in a textview. No need to override onClick method

Alternatively, you can use setHint () in the class.

+9
source

( ) onclick ( , TextView). Yous , , reset , .

0

Source: https://habr.com/ru/post/1781754/


All Articles