我使用 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/