zoukankan      html  css  js  c++  java
  • Android资料之-EditText中的inputType

    在编写有EditText的自定义控件的时候可能会用到EditText的inputType属性,直接在xml里写这个属性的时候是用字符串型 的,不过动态设置的时候就变成int型了,InputType里有定义了对应的常量,在自定义控件需要通过在xml里写参数的形式来控制控件里的 EditText的这个属性的时候,可以根据字符型返回对应的int值来动态设置。
    下面是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" 时间键盘

  • 相关阅读:
    利用API将软件嵌入网页中
    TensorFlow:tf.train.Saver()模型保存与恢复
    TensorFlow:tf.reduce_mean(input_tensor, axis=None, keep_dims=False, name=None, reduction_indices=None)
    TensoFlow的tf.reshape()
    Python:查看矩阵大小,查看列表大小
    TensorFlow:tf.contrib.layers.xavier_initializer
    python:list
    TensorFlow-Python:创建空列表list与append的用法
    MATLAB:读取mat文件中物体的三维坐标,显示三维模型
    查看已装TensorFlow的版本和路径
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/3727492.html
Copyright © 2011-2022 走看看