日期/时间选择器不显示在Android 4.1.2应用程序 [英] Date/Time Picker not showing on Android 4.1.2 app

查看:206
本文介绍了日期/时间选择器不显示在Android 4.1.2应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JQuery Mobile 1.3.1使用下面的代码创建一个包含日期和时间选择器的表单:

 < div data-role =fieldcontain> 
< label for =date>日期< / label>
< input name =dateid =dateplaceholder =value =type =date/>
< / div>
< div data-role =fieldcontain>
< label for =time>时间< / label>
< input name =timeid =timeplaceholder =value =type =time/>
< / div>

当我用笔记本电脑或Safari浏览器打开网页时,日期和时间选择器会按预期显示如下所示。







我创建了一个Android 4.1.2应用程序,基本上只是一个PhoneGap应用程序, JQuery Mobile代码。问题是,当我启动应用程序时,日期和时间选择器不显示在Android应用程序上,当我触摸输入框只有键盘出现。

解决方案

如果phonegap使用设备的默认浏览器作为应用程序加载html,它可能无法在Android上工作,因为它不完全支持新的html5输入类型日期和时间。 HTML5测试可证明其此处。您可以在此处查看iDevices是否支持新的HTML5日期和时间输入。所以,如果phonegap使用内置的浏览器或webview,它可能无法完全与Android 4.x和更低。


I have used JQuery Mobile 1.3.1 to create a form that has a date and a time picker using the code below:

<div data-role="fieldcontain">
    <label for="date">Date</label>
    <input name="date" id="date" placeholder="" value="" type="date" />
</div>
<div data-role="fieldcontain">
    <label for="time">Time</label>
    <input name="time" id="time" placeholder="" value="" type="time" />
</div>

The date and time pickers display as expected when I open the web page with chrome on my laptop or safari on my phone as is shown below.

I created an Android 4.1.2 application that is basically just a PhoneGap app that points towards a URL that contains the JQuery Mobile code. The problem is that when I launch the app the date and time pickers are not displayed on the android application when I touch the input box only the keyboard appears.

解决方案

If phonegap uses the device's default browser to load the html as an app, it might not work on android because it does not fully support the new html5 input types "date" and "time". The HTML5 test proves it here. You can see here that iDevices support the new HTML5 date and time inputs. So, if phonegap uses a built in browser or webview, it may not work fully with android 4.x and lower.

这篇关于日期/时间选择器不显示在Android 4.1.2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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