Android软件键盘以编程方式在数字和字母之间切换 [英] Android software keyboard switch between numeric and alphabetic programmatically

查看:399
本文介绍了Android软件键盘以编程方式在数字和字母之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 inputMode = text 的EditText.默认情况下,软件键盘显示为字母,并且用户必须通过按特定键(例如"123")将其切换为数字.

I have an EditText with inputMode = text. By default software keyboard is shown as alphabetical and user have to switch it to numeric by pressing specific key (like "123").

具有文本 inputMode,是否可以默认显示数字键盘而不是字母键盘?

Having text inputMode is it possible to show numeric keyboard by default instead of alphabetic?

我需要字母和数字.但是,与字母相比,数字更常用,因此我寻找以编程方式切换模式的方法.

I need both alphabetic and numeric. But numeric is used more often then alphabetic so i search for way to switch mode programmatically.

推荐答案

我每天都找到答案,最后我找到了它及其工作.

I find the answer a day, finally I found this and its work.

android:inputType="textVisiblePassword"

来源

这篇关于Android软件键盘以编程方式在数字和字母之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆