简体   繁体   English

如何在iPhone上禁用URL和底部栏

[英]How to disable url & bottom bar on iphone

I am making an web app in html, css and js nad would like to hide the address bar and the bottom bar in the web browser on iPhone. 我正在用html,css和js制作Web应用程序,nad想在iPhone的网络浏览器中隐藏地址栏和底部栏。

I've had no luck so far and have tried with following: 到目前为止,我还没有运气,并尝试了以下方法:

   /mobile/i.test(navigator.userAgent) && setTimeout(function () {
   window.scrollTo(0, 1);
   }, 1000);

And used the meta tags: 并使用了meta标签:

name="apple-mobile-web-app-status-bar-style" content="black"
name="apple-mobile-web-app-capable" content="yes"

In the native Safari browser on IOS, there is no way to disable the menu and address bar. 在IOS上的本机Safari浏览器中,无法禁用菜单和地址栏。 This would normally disappear when the user is scrolling. 当用户滚动时,这通常会消失。 If you make a bookmark on the home screen by pressing the share button . 如果您通过按“ 共享”按钮在主屏幕上添加书签。 The web app will appear without the address bar and menu bar. 该网络应用程序将不显示地址栏和菜单栏。 Hope this helped! 希望这对您有所帮助! -Todd -托德

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM