隐藏iPhone上的Safari用户界面组件 [英] Hiding Safari User Interface Components on iPhone
问题描述
试图隐藏作为主屏幕图标书签的网络应用程序的Safari UI组件。我正在使用此元标记
In an attempt to hide the Safari UI components for an web-app bookmarked as a Homescreen Icon. I am using this meta tag
<meta name="apple-mobile-web-app-capable" content="yes" />
在 iPhone开发中心但地址栏和工具栏是从主屏幕图标启动时仍然存在。我需要做些什么呢?有没有人有例子?
as specified on iPhone Dev Center but the address bar and toolbar are still there when launched from the home screen icon. What do I need to do different? Does anyone have an example?
推荐答案
window.top.scrollTo(0, 1);
适用于iPhone,但不适用于iPad。通过使用
Works on iPhone, but not in iPad. I have been successful hiding the browser components on iPad (so presumably everywhere) by using
<meta name="apple-mobile-web-app-capable" content="yes" />
并从主屏幕链接启动。我也在使用
and launching from a home-screen link. I am also using
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
如果我遗漏视口属性,我还没有尝试查看浏览器组件是否仍然隐藏。
I have not tried seeing if the browser components are still hidden if I leave out the viewport properties.
这篇关于隐藏iPhone上的Safari用户界面组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!