限制只输入某些值包括数字、字母等

android:digits="0123456789abcdefghigklmnopqrstuvwxyz"
上面这行代码可以是你任何的限制,只能输入什么就到里面写就可以了,上面写的是只可以输入数字和字母。

android:inputType="textPassword"android:digits="0123456789abcdefghigklmnopqrstuvwxyz"
这里是只能输入数字和字母并且是密码格式,这两个设置并没有冲突,android:inputType="textPassword"这里是文本,是可以输入中文的,但是要是你加了android:digits="0123456789abcdefghigklmnopqrstuvwxyz",inputType这里的中文就会失效了,但是password不会失效,这里只是打个比方,大家都懂的。

inputType的属性值

 
    android:inputType="none"    android:inputType="text"    android:inputType="textCapCharacters" 字母大写    android:inputType="textCapWords" 首字母大写    android:inputType="textCapSentences" 仅第一个字母大写    android:inputType="textAutoCorrect" 自动完成    android:inputType="textAutoComplete" 自动完成    android:inputType="textMultiLine" 多行输入    android:inputType="textImeMultiLine" 输入法多行(如果支持)    android:inputType="textNoSuggestions" 不提示    android:inputType="textUri" 网址    android:inputType="textEmailAddress" 电子邮件地址    android:inputType="textEmailSubject" 主题    android:inputType="textShortMessage" 短讯    android:inputType="textLongMessage" 长信息    android:inputType="textPersonName" 人名    android:inputType="textPostalAddress" 地址    android:inputType="textPassword" 密码    android:inputType="textVisiblePassword" 可见密码    android:inputType="textWebEditText" 作为网页的文本    android:inputType="textFilter" 文本筛选过滤    android:inputType="textPhonetic" 拼音输入 //数值类型    android:inputType="number" 数字    android:inputType="numberSigned" 带符号数字格式    android:inputType="numberDecimal" 带小数点的浮点格式    android:inputType="phone" 拨号    android:inputType="datetime" 时间日期    android:inputType="date" 日期键盘    android:inputType="time" 时间键盘

更多相关文章

  1. android讲义2之输入界面
  2. Android用户界面 UI组件--自动提示输入框 AutoCompleteTextView
  3. Android(安卓)EditText属性用法
  4. android EditText inputType说明
  5. 向Android模拟器发短信打电话
  6. Android虚拟键盘挡住输入组件的解决办法
  7. android 实现qq聊天对话界面效果
  8. android 无线调试
  9. android系统中自带的图标大全

随机推荐

  1. Android(安卓)http get/post传递参数
  2. android中activity栈详解
  3. Android(安卓)大文件上传时,处理上传进度
  4. Android(安卓)requires compiler complia
  5. android 6.0以下,拒绝录音权限后处理
  6. Android(安卓)Service使用
  7. Android(安卓)killall 命令
  8. android 获取应用签名文件的sha1值、md5(
  9. android SQLite (Cursor SQLiteDatabase S
  10. 常用布局及基本 UI 控件(2)