android EditText中的inputType

每次在开发中,容易忘记EditText中inoutType的属性,下面我们就总结一下:

      android 1.5以后添加了软件虚拟键盘的功能,所以在输入提示中将会有对应的软键盘模式

android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大

的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以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" 时间键盘

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 172,930评论 25 708
  • 在android2.3版本,许多edittext属性不建议使用了,那么这些不建议使用的属性都去哪了?官方也不可能将...
    猿ape阅读 387评论 0 2
  • 这是一篇关于Android EditText中的inputType详解,因为Android中inputType属性...
    逝水了无痕阅读 9,235评论 0 3
  • 中国有句古话叫养儿防老,还说多子多福,特别是在农村,没儿子的都会被人瞧不起,非要生出儿子才罢休。有些人为了生儿子避...
    理财人生阅读 566评论 1 0
  • 能叫仙人流连忘返的还真不多,这要数的上头筹!这三要素,是评价一个歌者的,没有几人堪受![悠闲][悠闲][悠闲] 男...
    纵情嬉戏天地间阅读 253评论 0 0