Android的默认的EditText数字键盘,让文字 [英] Android EditText default numeric keyboard and allow text

查看:172
本文介绍了Android的默认的EditText数字键盘,让文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/3544214/edittext-with-number-keypad-by-default-but-allowing-alphabetic-characters">EditText由默认的数字键盘,但允许字母

想知道是否可以默认为一个数字键盘上聚焦为一个EditText领域,而且允许用户输入字符?无输入类型似乎支持这一点。 谢谢!

Wondering if it is possible to default to a numeric keyboard on focus for an edittext field but also allow users to input characters? None of the input types seem to support this. Thanks!

推荐答案

我只是想加入Android的一些文本字段,它运行在模拟器罚款。它默认为打开数字键盘第一,但你可以切换到文字一样简单。因此,尝试使用一些文本字段。

I just tried to add a number text field in Android and it ran in the emulator fine. It defaults to bring up the number pad first, but you can switch to characters just as easy. So try to use a number text field.

<EditText
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="number" />

这篇关于Android的默认的EditText数字键盘,让文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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