Android中EditText的inputType属性

来源:互联网 发布:js截取字符串返回数组 编辑:程序博客网 时间:2024/06/05 16:10

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” 时间键盘

android:inputType="numberSigned|numberDecimal"--有符号的浮点数,能输入小数点,也能输入正负数。


Android 如何让EditText不自动获取焦点
解决之道:在EditText的父级控件中找一个,设置成
  android:focusable="true"  
  android:focusableInTouchMode="true"