How to force keyboard with numbers in mobile website in Android(如何在 Android 的移动网站中强制使用带有数字的键盘)
问题描述
我有一个移动网站,其中包含一些 HTML input
元素,如下所示:
I have a mobile website and it has some HTML input
elements in it, like this:
<input type="text" name="txtAccessoryCost" size="6" />
我已将该网站嵌入到 WebView
用于可能的 Android 2.1 消费,因此它也将是一个 Android 应用程序.
I have embedded the site into a WebView
for possible Android 2.1 consumption, so that it will also be an Android application.
当这个 HTML input
元素被聚焦时,是否可以获得带有数字的键盘而不是带有字母的默认键盘?
Is it possible to get the keyboard with numbers instead of the default one with letters when this HTML input
element is focused?
或者,是否可以为整个应用程序设置它(可能在 Manifest 文件),如果它对于 HTML 元素不可行?
Or, is it possible to set it for the whole application (maybe something in the Manifest file), if it is not feasible for an HTML element?
推荐答案
<input type="number" />
<input type="tel" />
当输入获得焦点时,这两个都会显示数字小键盘.
Both of these present the numeric keypad when the input gains focus.
<input type="搜索"/>
显示带有额外搜索按钮的普通键盘
<input type="search" />
shows a normal keyboard with an extra search button
其他一切似乎都调出了标准键盘.
Everything else seems to bring up the standard keyboard.
这篇关于如何在 Android 的移动网站中强制使用带有数字的键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Android 的移动网站中强制使用带有数字的


- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 拆分 Drawable 2022-01-01