Android编程开发之EditText中inputType属性小结
作者:Leo Chin 时间:2022-04-13 10:03:11
本文总结分析了Android编程开发之EditText中inputType属性。分享给大家供大家参考,具体如下:
android 1.5以后添加了软件虚拟键盘的功能,所以在输入提示中将会有对应的软键盘模式。
android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以inputType尤为重要。
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content"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" 时间键盘
希望本文所述对大家Android程序设计有所帮助。
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
C#实现FFT(递归法)的示例代码
![](https://img.aspxhome.com/file/2023/1/116611_0s.png)
Docker 存储驱动详细介绍
![](https://img.aspxhome.com/file/2023/1/83431_0s.png)
SpringCloud学习笔记之Feign远程调用
![](https://img.aspxhome.com/file/2023/1/119111_0s.png)
详解Java Synchronized的实现原理
![](https://img.aspxhome.com/file/2023/7/60037_0s.png)
Spring源码解析之Configuration
![](https://img.aspxhome.com/file/2023/8/105928_0s.png)
Java实例讲解注解的应用
Java Maven依赖传递,可选依赖,排除依赖详解
![](https://img.aspxhome.com/file/2023/9/66489_0s.png)
C#窗体间通讯的几种常用处理方法总结
![](https://img.aspxhome.com/file/2023/1/94661_0s.jpg)
springBoot详解集成Swagger流程
![](https://img.aspxhome.com/file/2023/0/89640_0s.png)
解决C#调用dll提示
![](https://img.aspxhome.com/file/2023/2/102182_0s.png)
C#操作config文件的具体方法
C#中const用法详解
SpringBoot数据层测试事务回滚的实现流程
![](https://img.aspxhome.com/file/2023/6/75776_0s.png)
Java设计模式之Strategy模式
Android中手机震动的设置(Vibrator)的步骤简要说明
描述C#多线程中lock关键字的使用分析
Java新特性之Nashorn_动力节点Java学院整理
![](https://img.aspxhome.com/file/2023/2/62822_0s.png)
Unity3D开发实战之五子棋游戏
![](https://img.aspxhome.com/file/2023/8/100158_0s.gif)
implicit关键字做自定义类型隐式转换的方法
Java设计模式之享元模式
![](https://img.aspxhome.com/file/2023/3/66063_0s.jpg)