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

  • 相关阅读:
    A.2.1 定义函数输出|返回3个整数的和,平均值
    android 支持不同的设备 .
    Android 中的Theme和Style使用
    Android TabHost的使用(Tab为Layout)
    [转]Android高手进阶教程(五)之Android 中LayoutInflater的使用!
    Android的Handler使用
    Android中级教程之Log图文详解(Log.v,Log.d,Log.i,Log.w,Log.e)! .
    java实现文件单词频率统计
    安装Tomcat服务器
    Android中BroadcastReceiver使用总结
  • 原文地址:https://www.cnblogs.com/judes/p/5787831.html
Copyright © 2011-2022 走看看