zoukankan      html  css  js  c++  java
  • android EditText中的inputType

     1 android 1.5以后添加了软件虚拟键盘的功能,所以在输入提示中将会有对应的软键盘模式
     2 android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以inputType尤为重要。
     3 <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="phone" />
     4 //文本类型,多为大写、小写和数字符号。
     5     android:inputType="none"
     6     android:inputType="text"
     7     android:inputType="textCapCharacters" 字母大写
     8     android:inputType="textCapWords" 首字母大写
     9     android:inputType="textCapSentences" 仅第一个字母大写
    10     android:inputType="textAutoCorrect" 自动完成
    11     android:inputType="textAutoComplete" 自动完成
    12     android:inputType="textMultiLine" 多行输入
    13     android:inputType="textImeMultiLine" 输入法多行(如果支持)
    14     android:inputType="textNoSuggestions" 不提示
    15     android:inputType="textUri" 网址
    16     android:inputType="textEmailAddress" 电子邮件地址
    17     android:inputType="textEmailSubject" 邮件主题
    18     android:inputType="textShortMessage" 短讯
    19     android:inputType="textLongMessage" 长信息
    20     android:inputType="textPersonName" 人名
    21     android:inputType="textPostalAddress" 地址
    22     android:inputType="textPassword" 密码
    23     android:inputType="textVisiblePassword" 可见密码
    24     android:inputType="textWebEditText" 作为网页表单的文本
    25     android:inputType="textFilter" 文本筛选过滤
    26     android:inputType="textPhonetic" 拼音输入
    27 //数值类型
    28     android:inputType="number" 数字
    29     android:inputType="numberSigned" 带符号数字格式
    30     android:inputType="numberDecimal" 带小数点的浮点格式
    31     android:inputType="phone" 拨号键盘
    32     android:inputType="datetime" 时间日期
    33     android:inputType="date" 日期键盘
    34     android:inputType="time" 时间键盘

    补充下,有人问代码怎么设置:

      editText.setInputType(type);//InputType.TYPE_CLASS_PHONE里封装了很多,EditorInfo里面也有很多
  • 相关阅读:
    .NET开源项目
    关于微信号的校验
    java 中关于synchronized的通常用法
    关于java 定时器的使用总结
    新的博客已经启用,欢迎大家访问(402v.com)
    Hadoop综合大作业
    hive基本操作与应用
    理解MapReduce计算构架
    熟悉HBase基本操作
    第三章 熟悉常用的HDFS操作
  • 原文地址:https://www.cnblogs.com/itpepe/p/4818260.html
Copyright © 2011-2022 走看看