使用iOS 7.1 minimal-ui从纵向切换到横向时可见灰色区域 [英] Gray area visible when switching from portrait to landscape using iOS 7.1 minimal-ui
问题描述
在我正在处理的Web应用程序中,我尝试了iOS 7.1的新 minimal-ui
功能(参见 iOS 7.1中的safari全屏,带有最小的ui元标记),但我是看到当我从纵向切换到横向时底部出现84px高灰色区域的问题。此外, document.body.scrollTop
切换到横向后更改为64.
In a web application that I am working on, I tried out iOS 7.1's new minimal-ui
feature (see safari fullscreen in iOS 7.1 with minimal-ui meta tag), but I am seeing an issue where an 84px-high gray area appears at the bottom when I switch from portrait to landscape. Also, document.body.scrollTop
changes to 64 after switching to landscape.
您可以使用<查看问题< a href =http://www.creativepulse.gr/en/blog/2014/hello-world-web-app-for-android-and-ios =nofollow noreferrer>这个Hello World网络应用程序: http://www.creativepulse .gr / media / blog / 2014/20140123-hello-world / example.html
当我在iOS 7.1 iPhone Retina上的Mobile Safari中加载应用程序时模拟器,在纵向模式下一切都很好。但是,切换到横向时,会立即显示灰色区域。
When I load the app in Mobile Safari on iOS 7.1 iPhone Retina Simulator, everything is fine in portrait mode. However, switching to landscape, the gray area immediately appears.
解决此问题的好方法是什么?
What is a good way to fix this issue?
推荐答案
在页面渲染后滚动到顶部对我有帮助。它以某种方式导致重新渲染并且灰色框消失,但我无法解释Safari在内部的确切行为:
Scrolling to the top after the page has rendered helped me. It somehow causes a rerendering and the grey box disappears, however I can't explain what exactly Safari does internally:
window.scrollTo(0, 0);
这篇关于使用iOS 7.1 minimal-ui从纵向切换到横向时可见灰色区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!