开发者

Adding a cancel button/icon on EditText with TextWatcher

开发者 https://www.devze.com 2023-04-12 22:01 出处:网络
I have an EditText with a TextWatcher attached to it and the onChangeText method w开发者_运维知识库orks flawlessly.

I have an EditText with a TextWatcher attached to it and the onChangeText method w开发者_运维知识库orks flawlessly.

I'd like to add a mini icon/button at the very right end of the EditText, which clears the text and then disappears.

May I have some direction on how to implement this? I don't want source code, but an idea on what mechanism to use. Thank you in advance.


I would say you have it in your Layout permanently as you want it to look but you normally have the Visibility set to GONE then just set it to VISIBLE when you want it shown.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号