美文网首页
EditText设置输入的类型

EditText设置输入的类型

作者: 爱你忘了熟悉 | 来源:发表于2018-09-03 16:44 被阅读157次

1.只能输入数字

android:numeric="integer" 

2.只能输入字母和数字

android:digits="0123456789qwertyuioplkjhgfdsazxcvbnm" 

3.只能输入英文字母(小写)和数字

android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

4.其他常用

android:singleLine //是否单行或者多行,回车是离开文本框还是文本框增加新行

android:autoText //自动拼写帮助

android:capitalize //首字母大写

android:password //密码

android:phoneNumber // 输入电话号码

android:editable //是否可编辑

android:autoLink=”all” //设置文本超链接样式当点击网址时,跳向该网址

android:password="true"//设置只能输入密码

android:digits //设置只接受某些数字

android:capitalize = "characters"//以大写字母写

5.引用文章

1.Android限定EditText的输入类型为数字或者英文(包括大小写)

https://blog.csdn.net/dajian790626/article/details/17798053

2.Android EditView自定义正则表达式

https://blog.csdn.net/u012246458/article/details/73466048

感谢作者

相关文章

网友评论

      本文标题:EditText设置输入的类型

      本文链接:https://www.haomeiwen.com/subject/glkiwftx.html