使EditText接受非英文数字 [英] Make EditText accept non-English numbers

查看:102
本文介绍了使EditText接受非英文数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个非常简单的应用程序,只包含数字,不需要创建其他语言环境文件夹或其他任何内容.

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屋!

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