如何强制键盘与数字在Android手机网站 [英] How to force keyboard with numbers in mobile website in Android

查看:157
本文介绍了如何强制键盘与数字在Android手机网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个移动网站,它有一些HTML 输入它元素,像这样的:

<输入类型=文本名称=txtAccessoryCost大小=6/>

我已经嵌入网站成为一个 的WebView 的可能的Andr​​oid 2.1的消费,因此,它也将是一个Android应用程序。

是否有可能获得键盘与数字,而不是默认的字母时,此HTML 输入元素的重点是?

或者,是否可以将其设置为整个应用程序(或许真的在清单文件),如果它不是一个HTML元素是否可行?

解决方案

 <输入类型=数字/>
<输入类型=电话/>
 

这两个present数字键盘在输入获得焦点。

<输入类型=搜索/> 显示了普通键盘有一个额外的搜索按钮

一切似乎调出标准键盘。

I have a mobile website and it has some HTML input elements in it, like this:

<input type="text" name="txtAccessoryCost" size="6" />

I have embedded the site into a WebView for possible Android 2.1 consumption, so that it will also be an Android application.

Is it possible to get the keyboard with numbers instead of the default one with letters when this HTML input element is focused?

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="search" /> shows a normal keyboard with an extra search button

Everything else seems to bring up the standard keyboard.

这篇关于如何强制键盘与数字在Android手机网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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