如题,在Android中,EditText可以自动获得焦点,并且自动弹出软键盘,但是软键盘的输入方式怎么设置呢?比如想让它在一个EditText时,默认弹出英文输入法,到另一个EditText时,想让它默认是中文输入法?(不是单纯的数字键盘和文字键盘之间的切换,因为数字键盘实现很简单)
5条回答 默认 最新
关注 在xml中设置inputType属性即可、
API中有,列举出来inputType的值都包括哪些。
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” 时间键盘
解决 无用评论 打赏 举报
悬赏问题
- ¥100 Jenkins自动化部署—悬赏100元
- ¥15 关于#python#的问题:求帮写python代码
- ¥20 MATLAB画图图形出现上下震荡的线条
- ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
- ¥15 perl MISA分析p3_in脚本出错
- ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
- ¥15 ubuntu虚拟机打包apk错误
- ¥199 rust编程架构设计的方案 有偿
- ¥15 回答4f系统的像差计算
- ¥15 java如何提取出pdf里的文字?