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里面也有很多
  • 相关阅读:
    java中计算两个时间差
    增强for循环用法
    SQLServer类型与Java类型转换问题解决
    有关SQL模糊查询
    js 弹出div窗口 可移动 可关闭 (转)
    登陆sqlserver及修改端口号 (转)
    C#判断IP地址是否合法函数-使用正则表达式-2个 (转)
    c#图像处理入门(-bitmap类和图像像素值获取方法) 转
    MongoDB C#驱动中Query几个方法 (转)
    微信公众帐号自定义菜单创建及事件响应开发教程 附源代码(转)
  • 原文地址:https://www.cnblogs.com/itpepe/p/4818260.html
Copyright © 2011-2022 走看看