在 iphone 和 android 的移动 DNN webApp 上隐藏地址栏
Hide address bar on mobile DNN webApp for iphone and android
我正在尝试隐藏 iphone 和 android 的地址栏(如果可能),并且看到多个线程通过插入以下代码片段作为其 DNN 网站的一部分以下进入他们的 default.aspx 文件:
<%-- 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">
我正在尝试隐藏 iphone 和 android 的地址栏(如果可能),并且看到多个线程通过插入以下代码片段作为其 DNN 网站的一部分以下进入他们的 default.aspx 文件:
<%-- 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">