1.android:imeOptions属性

默认情况下软键盘右下角的按钮为“下一个”,点击会到下一个输入框,保持软键盘


设置 android:imeOptions="actionDone" ,软键盘下方变成“完成”,点击后光标保持在原来的输入框上,并且软键盘关闭


android:imeOptions="actionSend"软键盘下方变成“发送”,点击后光标移动下一个


2.

android: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:textCursorDrawable

改变光标的颜色

android:textCursorDrawable="@null" 设成和文字一样的颜色
改变为其他颜色: android:textCursorDrawable="@drawable/edittext_cursor"
edittext_cursor.xml
[html] view plain copy
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <shapexmlns:android="http://schemas.android.com/apk/res/android">
  3. <sizeandroid:width="2dp"/>
  4. <solidandroid:color="#BDC7D8"/>
  5. </shape>


更多相关文章

  1. TensorFlow模型移植Android识别手写数字(MNIST)
  2. Android(安卓)EditText限制输入数字和字母
  3. Android(安卓)实现绚丽多彩的TextView
  4. 百度地图开发 android App 数字签名(SHA1)获取办法
  5. EditText常用属性【一】:空白提示/文本域/特殊字符/数字类型/等
  6. android span相关
  7. Android(安卓)Studio中读取文本文件内容方法
  8. Android笔记——如何将软键盘的回车键改为搜索键
  9. Android下Opengl程序显示文字的简单方法

随机推荐

  1. 在Android中使用FFmpeg(android studio环
  2. Study on Android【二】--ContentProvide
  3. Android(安卓)轻松实现语音识别
  4. Android实现人脸识别(人脸检测)初识
  5. Antrus – 我搞的一个Android下的MVC开源
  6. android service深入
  7. Android开发学习笔记:浅谈ToggleButton
  8. 从Android设备获取实时截屏
  9. (转) Android的Window类
  10. Android中AsyncTask使用详解