加载网络应用程序时,我需要隐藏 ipod touch 中的 URL 栏,我尝试了在线找到的所有可能解决方案,包括此处找到的解决方案: http ://www.iphonemicrosites.com/tutorials/how-to-hide-the-移动浏览器中的地址栏/
并在 CSS 中设置 min-height,但它只适用于横向和配置文件模式,它只隐藏 URL 栏的一部分而不是整个栏。有人知道吗?谢谢。
下面是我的代码:
<meta name="app-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="viewport" content="width=320;initial-scale=0.6666;;minimum-scale=0.6666; maximun-scale=1.0;"/>
<title>Test</title>
<script type="application/x-javascript">
addEventListener("load", function()
{
setTimeout(updateLayout, 0);
}, false);
var currentWidth = 0;
function updateLayout()
{
if (window.innerWidth != currentWidth)
{
currentWidth = window.innerWidth;
var orient = currentWidth == 320 ? "profile" : "landscape";
document.body.setAttribute("orient", orient);
setTimeout(function()
{
window.scrollTo(0, 1);
}, 100);
}
}
setInterval(updateLayout, 100);
</script>
<link media="only screen and (max-device-width: 320px)" href="style.css" rel="stylesheet" type="text/css" />
...