![](/img/trans.png)
[英]How to hide Address bar of a responsive webapp when opening through mobile browser?
[英]Hide address bar on mobile DNN webApp for iphone and android
我试图隐藏iphone和android的地址栏(如果可能的话),并通过将以下代码插入到他们的default.aspx文件中,看到多个线程将以下代码片段用作其DNN网站的一部分:
<%-- Add mobile bookmark buttons --%>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes">
<%-- Set Apple icons. --%>
<asp:PlaceHolder ID="appleIcons" runat="server" />
<%-- Set view port for mobile devices. --%>
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width, minimal-ui">
<%-- Set Apple icons. --%>
<link rel="apple-touch-icon" href="/Portals/0/images/apple-touch-icon-114x144.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/Portals/0/images/apple-touch-icon-114x144.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/Portals/0/images/apple-touch-icon-114x144.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/Portals/0/images/apple-touch-icon-114x144.png" />
<%-- Remove URL bar on mobile devices. --%>
<script type="application/x-javascript">
addEventListener("load", function() { setTimeout( hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); }
</script>
我已经测试了有关此主题的所有相关主题。 上面的内容在以前只能在iPhone上运行的网站上有效,但不再对我有用。 感谢任何评论。
更新:要回答我自己的问题(注释仅在移动WebApp上有效,而在移动浏览器上无效):
<%-- Add Apple & Android bookmark buttons --%>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes">
<%-- Set view port for Apple & Android devices. --%>
<meta name = "viewport" content = "width=device-width" />
<meta name="viewport" content="width=device-width, minimal-ui">
<%-- Set Apple & Android icons. --%>
<link rel="apple-touch-icon" sizes="96x96" href="/Portals/0/images/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<%-- Set Apple Smart App Bannner by entering app store url in app id field below. --%>
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.