Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7394
  • 博文数量: 6
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-22 17:07
文章分类
文章存档

2015年(6)

我的朋友
最近访客

分类: Android平台

2015-04-01 20:43:25

Android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以inputType尤为重要。

设置文本的类型,用于帮助输入法显示合适的键盘类型。

有如下值设置:

nonetext

textCapCharacters字母大小、

textCapWords单词首字母大小、

textCapSentences仅第一个字母大小、

textAutoCorrect

textAutoComplete自动完成、

textMultiLine多行输入、

textImeMultiLine输入法多行(如果支持)、

textNoSuggestions不提示、

textEmailAddress电子邮件地址、

textEmailSubject邮件主题、

textShortMessage短信息(会多一个表情按钮出来,点开如下图

textLongMessage长讯息?

textPersonName人名、

textPostalAddress地址、

textPassword密码、

textVisiblePassword可见密码(实现禁止输入中文)、

textWebEditText作为网页表单的文本、

textFilte文本筛选过滤、

textPhonetic拼音输入、

numberSigned有符号数字格式、

numberDecimal可带小数点的浮点格式、

phone电话号码、

datetime时间日期、

date日期、

time时间

android:inputType="phone" />
 //文本类型,多为大写、小写和数字符号。
    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"//时间键盘

阅读(251) | 评论(0) | 转发(0) |
0

上一篇:js中的$()方法

下一篇:JDK知识自述己见:

给主人留下些什么吧!~~