隐藏iPhone上的Safari用户界面组件 [英] Hiding Safari User Interface Components on iPhone

查看:218
本文介绍了隐藏iPhone上的Safari用户界面组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图隐藏作为主屏幕图标书签的网络应用程序的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆