【发布时间】:2014-03-07 17:44:01
【问题描述】:
我已经使用 Asp.Net MVC 设计和开发了一个 Web 应用程序,并添加了一些元标记以使看起来像一个 iPhone 应用程序。 现在,当我第一次在 iPhone 上打开应用程序时,如何提示用户在主屏幕上添加该页面,而不是从 iPhone 上可用的选项手动添加。
我已将以下元标记添加到我的头部标记
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon"
href="~/Images/icon.png" />
<link rel="mobile-touch-icon"
href="~/Images/icon.png" />
<link rel="apple-touch-startup-image"
href="~/Images/startup.png" />
<meta name="mobile-web-app-capable" content="yes">
</head>
<body>
<script>
if (window.navigator.userAgent.indexOf('iPhone') != -1) {
if (window.navigator.standalone == true) {
initialize();
}else{
document.write('<p>Tap the + button and choose "Add to Home Screen"</p>');
}
}
</script>
</body>
如何提示用户在主屏幕上添加页面?
【问题讨论】:
标签: ios iphone html asp.net-mvc-4