iphone - 在 ios7 上,<input type=date> 在没有默认值的情况下不会显示在 webview 中

标签 iphone ios html ios7

我使用 UIWebview 来显示 html 页面。在页面中,我有日期和时间类型,而不是日期时间。 但ios7上不显示该字段。 ios6上没问题。 下面是CSS代码:

div.answer-time-picker {
        padding: 10px 9px;
    }

    .answer-time-picker input {
        font-size: 17px;
        font-weight: normal;
        display: block;
        width: 100%;
        -webkit-box-sizing: border-box;
        border: none;
        -webkit-appearance: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }

有什么问题吗?

非常感谢!

更新: 我发现,如果有默认值,它就可以正常工作。 但如果没有值,则不会显示空字段。 如何强制它显示空字段以供用户单击?

最佳答案

看起来此输入类型已在 iOS 7 中删除

http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review

Following Google Chrome, now Safari on iOS doesn’t support the datetime input type anymore and it will fallback to text. This type was deprecated in the standard in favor of using two inputs, date and time for the same purpose. The problem is that datetime was compatible with iOS from version 5.0 to 6.1; if you are using it, be careful!

关于iphone - 在 ios7 上,<input type=date> 在没有默认值的情况下不会显示在 webview 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18973594/

相关文章:

html - 不知道如何做到这一点。4 个文本部分均匀分布在页面上?

jquery - Bootstrap 3 垂直导航栏响应

php - 使用输入字段(类型文件)选择图像后更改文本

iphone - _var 和 self.var 的区别

iphone - ios http live黑屏

iphone - 应用程序崩溃,但仅在为 Ad-Hoc 发行版构建时

iOS 应用程序打开网站 URL

iphone - iPhone GPS 能否为正在运行的应用程序提供准确的速度?

ios - 我应该使用哪种方法在 UICollectionViewCell 之间执行某些操作?

ios - 文本转语音 API 不适用于 iOS