Android – automatically display error text in EditText

I'm using similar code

EditText.setError("Something went wrong");

Display errors on EditText. However, only exclamation marks are displayed

How to automatically display error text without touching the icon first?

resolvent:

You can set the focus to EditText so that users don't have to click it

editText.requestFocus()

However, only one error will be displayed this time. I believe this may still be the best way, because this is the way the platform implements it

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>