输入类型= iOS 7中的日期 [英] input type=date in iOS 7
问题描述
我已经开发了一个移动Web应用程序,我注意到有关iOS 7的更改,具体如下:
I have developed a mobile web application and I noticed a change concerning iOS 7, specifically:
- 如果网页表单包含type = date的输入标签,日期字段的值为空(无日期值),然后在Safari中以奇怪的方式呈现该字段,以使文本框的高度非常小(约为25%正常输入类型的高度=文本框)。一旦将日期输入到控件中,则文本框的高度与type =文本框相同。
这在iOS 6中没有发生,但在iOS 7中正在发生。问题是,看起来并不好看这些日期输入框以这种方式呈现。我更喜欢它们看起来像一个普通的type =文本框,即使是空的。
This did not happen in iOS 6 but is happening in iOS 7. The problem is that it does not look good to me to see these date input boxes rendered in this way. I would prefer that they look the same as a normal type=text box even when empty.
- 有什么事情可以做到这一点吗?
- 是否有一些初始值可以传递给type = date文本框,使它们像往常一样呈现?
提前感谢
/ strong>
updated with screenshots:
好:
bad:
(该白盒应该更高,显示占位符文本)
(that white box should be taller and showing placeholder text)
推荐答案
建议以上,解决方法是手动设置输入类型的高度= date html控件。对我来说,高度为20像素,与页面上的其他控件看起来一样,看起来不错。
As suggested above, the solution is to manually set the height of the input type=date html control. A height of 20px for me makes it appear to be the same as the other controls on the page and it looks good.
这篇关于输入类型= iOS 7中的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!