EditText(1)EditText的类型和回车键的行为
2024-08-30 21:50:10
1,常见类型
<EditText
android:id="@+id/email_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/email_hint"
android:inputType="textEmailAddress" />
其中 android:inputType 用于指定键盘输入类型和回车键的行为。
text | Normal text keyboard. |
textEmailAddress | Normal text keyboard with the @ character. |
textUri | Normal text keyboard with the / character. |
number | Basic number keypad. |
phone | Phone-style keypad. |
date | |
time | |
textMultiLine |
2,回车键的行为
<EditText
android:id="@+id/postal_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/postal_address_hint"
android:inputType="textPostalAddress|
textCapWords|
textNoSuggestions" />
textCapSentences | Normal text keyboard that capitalizes the first letter for each new sentence. | 每句首字母大写 |
textCapWords | Normal text keyboard that capitalizes every word. Good for titles or person names. | 每个单词大写 |
textAutoCorrect | Normal text keyboard that corrects commonly misspelled words. | 自动纠正一般拼写错误 |
textPassword | Normal text keyboard, but the characters entered turn into dots. | 心小黑点显示输入的内容 |
textMultiLine | Normal text keyboard that allow users to input long strings of text that include line breaks (carriage returns). | 可包含换行符等。 |
更多 | https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType |
最新文章
- ADO.NET 中的新增功能
- 转载 【CSS进阶】伪元素的妙用--单标签之美
- 用python+selenium抓取豆瓣电影中的正在热映前12部电影并按评分排序
- MyEclipse快捷键大全(绝对全)
- uTenux&mdash;&mdash;LED驱动讲解
- (转)A Beginner&#39;s Guide To Understanding Convolutional Neural Networks Part 2
- 深入Delphi -- Windows 消息机制
- StartSSL免费SSL证书成功申请-HTTPS让访问网站更安全
- 一个完整的SSL连接建立过程
- MSI文件静默安装
- [node] node 版本更新
- 点击button1弹出form2,并在form2中点击button2来调用form1的方法
- window下nginx的常用命令
- bugku web 矛盾
- copy 和 deepcopy的区别
- swp文件已存在
- mybatis返回部分字段为空的问题
- socket 映射服务器程序
- 这两周服务器被攻击,封锁了600多个IP地址段后今天服务器安静多了
- 使用 IntraWeb (8) - 系统模板