Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android EditText has input type with clear button?

Tags:

android

Does Android EditText has input type with clear button?

It should work like html 5 search input type.

enter image description here

like image 430
Alexey Zakharov Avatar asked Nov 16 '11 04:11

Alexey Zakharov


People also ask

How do I delete text in EditText?

just use the android:hint attribute in your EditText. This text shows up when the box is empty and not focused, but disappears upon selecting the EditText box. this should be the accepted answer, +1 for simplicity.

What is the use of TextInputLayout in android?

Layout which wraps a TextInputEditText , EditText , or descendant to show a floating label when the hint is hidden while the user inputs text.


2 Answers

There is no internal input-type, but you can customize it to work so. This link might help you: Stack-Overflow: EditText with clear button

like image 97
SamSPICA Avatar answered Oct 11 '22 02:10

SamSPICA


If you're using TextInputLayout that you can use endIconMode and endIconDrawable

like image 43
Ivan Krasilnikov Avatar answered Oct 11 '22 02:10

Ivan Krasilnikov