0

嘿,我正在制作一个用户有时应该写数字的应用程序。

有没有办法立即显示屏幕键盘的数字视图?那么用户不会对“百”而不是“100”吗?

非常感谢你

4

4 回答 4

1
android:numeric="integer"

在您的编辑文本中使用它...

你也可以使用十进制,有符号

更多详情http://androidblogger.blogspot.com/2009/01/numeric-edittext-and-edittext-with-max.html

于 2011-04-28T09:15:02.257 回答
1

检查EditText类的InputType属性。您可以将其设置为,以便用户只能在 EditText 中插入数字。在这种情况下,键盘应自动显示数字视图。number

于 2011-04-28T09:15:17.337 回答
1

我想你想设置 TextView inputType:http://developer.android.com/reference/android/widget/TextView.html#setInputType%28int%29

具体要求数字键盘的示例位于http://android-er.blogspot.com/2010/07/some-examples-of-inputtype-on-edittext.html

于 2011-04-28T09:15:39.740 回答
0

将下面的代码放入 Edittext 视图。. . .

android:numeric="integer"
android:phoneNumber="true"

如果此提示对您有帮助,请投票给我。. .

于 2011-04-28T09:31:35.567 回答