Html 如何在 iPhone 中隐藏 Safari Mobile 浏览器底部按钮栏?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9191240/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:21:54  来源:igfitidea点击:

How to hide Safari Mobile browser bottom button bar in iPhone?

iphonehtmlcssmobile-safari

提问by Awan

Following is head section:

以下是头部部分:

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />

    <link rel="apple-touch-icon" href="/custom_icon.png"/>
    <link rel="apple-touch-startup-image" href="/startup.png">

    <script src="http://www.google.com/jsapi"></script>

    <script>
      window.top.scrollTo(0, 1);
      alert('ok');
      google.load("jquery", "1.4.1");
      google.load("jqueryui", "1.8.0");
    </script>

</head>

using iOS 4.2.1

使用 iOS 4.2.1

Above is not working for me. Browser Address bar and bottom toolbar are still there. I have tried some tutorials but I am unable to change anything. Any idea?

以上对我不起作用。浏览器地址栏和底部工具栏仍然存在。我已经尝试了一些教程,但我无法改变任何东西。任何的想法?

采纳答案by BoltClock

You cannot programmatically hide the toolbar in Mobile Safari.

您无法在 Mobile Safari 中以编程方式隐藏工具栏。

Your users need to add your web app to their home screens in order for the bars to be hidden when they next launch your app by tapping its icon. This is done by tapping the middle button in the toolbar, then choosing Add to Home Screen. You may need to display a message informing your users to do this.

您的用户需要将您的网络应用程序添加到他们的主屏幕,以便在他们下次通过点击其图标启动您的应用程序时隐藏栏。这是通过点击工具栏中的中间按钮,然后选择添加到主屏幕来完成的。您可能需要显示一条消息,通知您的用户执行此操作。

回答by Mr. T

For iOS 7.1, you can set this in your header to minimize the UI:

对于 iOS 7.1,您可以在标题中设置此项以最小化 UI:

<meta name="viewport" content="width=device-width, minimal-ui">

It was introduced in iOS 7.1 beta 2. This site was instrumental in helping me understand how minimal-ui works: http://www.mobilexweb.com/blog/ios-7-1-safari-minimal-ui-bugs

它是在 iOS 7.1 beta 2 中引入的。这个网站有助于我理解 minimum-ui 的工作原理:http: //www.mobilexweb.com/blog/ios-7-1-safari-minimal-ui-bugs

回答by Jesper

You can use this litte useful JS project to help your user add the page to the homescreen: Add 2 Home

您可以使用这个小有用的 JS 项目来帮助您的用户将页面添加到主屏幕: Add 2 Home