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 的移动网站中强制使用带有数字的
基础教程推荐
- 在 iOS8 中无法获得正确的键盘高度值 2022-01-01
- 我的 UIImageView 的任务 2022-01-01
- 如何将多个组件添加到 PickerView? 2022-01-01
- 突出显示朗读文本(在 iPhone 的故事书类型应用程序中) 2022-01-01
- Android:STATE_SELECTED不工作 2022-01-01
- 在 appComponent dagger 2 中动态添加测试模块? 2022-01-01
- - (CGRect)convertRect:(CGRect)rect toView:(UIView *)view 如何工作 2022-01-01
- 可可/目标C(OSX不是iOS)从子对象访问父对象 2022-01-01
- 新的@SystemApi 注解是什么意思,和@hide 有什么区别 2022-01-01
- 在 Android 模拟器中激活网络位置提供程序? 2022-01-01
