zoukankan      html  css  js  c++  java
  • EditText输入属性

    1、

    android:inputType="none"

    android:inputType="text"

    android:inputType="textCapCharacters"//前3个输入普通字符

    android:inputType="textCapWords"//单词首字母大小

    android:inputType="textCapSentences"//仅第一个字母大小

    android:inputType="textAutoCorrect"

    android:inputType="textAutoComplete"//前两个自动完成

    android:inputType="textMultiLine"//多行输入

    android:inputType="textImeMultiLine"//输入法多行(不一定支持)

    android:inputType="textNoSuggestions"//不提示

    android:inputType="textUri"//URI格式

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

    2、

    输入法Enter键图标的设置:

    软件盘的界面替换只有一个属性android:imeOptions,这个属性的可以取的值有normal,actionUnspecified,actionNone,actionGo,actionSearch,actionSend,actionNext,actionDone,例如当值为actionNext时enter键外观变成一个向下箭头,而值为actionDone时enter键外观则变成了“完成”两个字。
    我们也可以重写enter的事件

    软键盘的Enter键默认显示的是“完成”文本,通过设置android:imeOptions来改变默认的“完成”文本。这里举几个常用的常量值:

    actionUnspecified  未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED. 
    actionNone 没有动作,对应常量EditorInfo.IME_ACTION_NONE
    actionGo 去往,对应常量EditorInfo.IME_ACTION_GO
    actionSearch 搜索,对应常量EditorInfo.IME_ACTION_SEARCH   
    actionSend 发送,对应常量EditorInfo.IME_ACTION_SEND  
    actionNext 下一个,对应常量EditorInfo.IME_ACTION_NEXT  
    actionDone 完成,对应常量EditorInfo.IME_ACTION_DONE 

    (EditorInfo.inputType & EditorInfo.TYPE_CLASS_MASK)可以是许多不同的值,包括:
    TYPE_CLASS_NUMBER
    TYPE_CLASS_DATETIME
    TYPE_CLASS_PHONE
    TYPE_CLASS_TEXT

  • 相关阅读:
    unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
    Go的学习笔记之Channel发送和接收
    聊聊 PC 端自动化最佳方案
    一文彻底搞懂快速幂(原理实现、矩阵快速幂)
    一次core.<number> 文件占满磁盘空间的处理过程
    博文目录
    备忘录:C#获取微信小程序的云数据库中数据
    T-SQL——关于跨库连接查询
    .NET异步程序设计——给线程传递数据
    自研 Pulsar Starter:winfun-pulsar-spring-boot-starter
  • 原文地址:https://www.cnblogs.com/judes/p/5787831.html
Copyright © 2011-2022 走看看