问题描述
iOS 7.1中的新minimal ui设置非常适合景观网站。我的网络应用程序使用全屏,绝对定位的div的内容,给它一个像应用程序的感觉。但Safari似乎只添加底部的URL栏的高度。我在不同的iPhone,尝试这个结果...相同的结果...
The new "minimal ui" setting in iOS 7.1 is great for landscape websites. My web app uses a fullscreen, absolute positioned div for its content, to give it an app-like feeling. But Safari seems to add just the height of the URL bar at the bottom. I have tried this on different iPhones, same result...
这是它看起来如何加载页面:
Here is how it looks after the pages loaded:
这是一个错误或某事,我做错了或缺少?
Is this a bug or something I am doing wrong or missing?
推荐答案
我对iPhone5 + ios7.1 + minimal-ui也有同样的问题。此代码成功修复了此问题。
I had same problem with iPhone5+ios7.1+minimal-ui. This code successfully fixes this trouble.
window.addEventListener('scroll', function () {
// Do not scroll when keyboard is visible
if (document.activeElement === document.body && window.scrollY > 0) {
document.body.scrollTop = 0;
}
}, true);
这篇关于在新的iOS 7.1 minimal-ui视口设置中是否有错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!