【问题标题】:Prompting an IPhone user to add a web page developed in Asp.Net MVC to home screen提示 iPhone 用户将用 Asp.Net MVC 开发的网页添加到主屏幕
【发布时间】: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


    【解决方案1】:

    不要自己尝试这样做,请查看 Cubic 的 Add to home screen script。易于配置,而且适用于各种 i 设备。

    【讨论】:

      猜你喜欢
      • 2019-01-26
      • 1970-01-01
      • 2010-11-11
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多