- 删除按钮仿苹果IOS的TextField,可通过设置属性clearButtonMode来设置按钮显示方式
compile 'com.optimus:editTextField:0.2.0'
xmlns:app="http://schemas.android.com/apk/res-auto"
app:clearButtonMode
,设置清除按钮的显示方式,其值如下:- never:不显示清空按钮 (默认)
- always:始终显示清空按钮
- whileEditing:输入框内容不为空且有获得焦点
- unlessEditing:输入框内容不为空且没有获得焦点
app:clearButtonDrawable
,可自定义设置清除按钮的图片。不设置此属性值时,使用默认图片。