使EditText接受非英文数字 [英] Make EditText accept non-English numbers
问题描述
我制作了一个非常简单的应用程序,只包含数字,不需要创建其他语言环境文件夹或其他任何内容.
I made a very simple app that involves only numbers and there is no need to make different locale folders or anything.
当我测试应用程序时,当键盘语言为英语时,EditText
将采用数字,但是当我将键盘更改为其他语言时,它将不起作用!按下数字将不会显示在EditText
中.
When I test the app, the EditText
will take numbers when the keyboard language is English, but when I change the keyboard to other languages it does not work! pressing a number will not show up in the EditText
.
是否有一种方法可以使EditText
采用通用数字而不管其语言是什么?
Is there a way to make the EditText
take universal numbers regardless of the language?
推荐答案
我认为它将起作用
<EditText
android:inputType="numberSigned|numberDecimal|numberPassword|number"/>
,并根据需要在选择器之间放置分隔符,即|
并按 ctrl + space ,您将获得更多选择.
and according your need put separator between choice i.e |
and press ctrl+space you will get more option .
这篇关于使EditText接受非英文数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!