2017-07-03 132 views
-2

我正在嘗試爲iOS創建一個非常基本的Web應用程序。 apple-mobile-web-app-capable不允許我的應用在獨立模式下運行。我已經按照蘋果自己的教程進行設置,並且在這個時候一直在網上瀏覽一個解決方案太久。我試過清除緩存並重新添加應用程序。我也嘗試刪除元標記並更改它,然後將其設置回去,同時刪除書籤,這是在另一個答案中提到的,它對我沒有任何幫助。iOS Web App無法正常工作

有人有解決方案嗎?

<DOCTYPE! html> 
<html> 
    <head> 
    <title>Test App</title> 
    <meta name="apple-mobile-web-app-title" content="Test App"> 
    <meta name="apple-mobile-web-app-capable" content="yes"> 
    <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
    <style> 
     #testButton { 
     -webkit-appearance: none; 
     font-size: 500%; 
     font-weight: bold; 
     width: 100%; 
     height: 100%; 
     } 
    </style> 
    </head> 
    <body> 
    <script> 
     function output(){ 
     alert("window.navigator.standalone = " + window.navigator.standalone); 
     } 
    </script> 
    <button id="testButton" onclick="output()">Test</button> 
    </body> 
</html> 
+0

你可以定義「*不正常*」嗎?預期的行爲是什麼?會發生什麼呢? –

+0

你的問題是什麼?目前還不清楚哪些是不起作用的。請具體說明。 –

回答

0

我遇到了和以前一樣的問題。顯然,自iOS 9以來,網絡應用程序無法按預期工作(我相信);然而,我發現您可以用標籤解決它:

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui"> 
<meta name="apple-mobile-app-capable" content="yes"> 

它爲我工作,希望它也爲您服務;)