iOS Web App无法正常工作
问题描述:
我正在尝试为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>
答
我遇到了和以前一样的问题。显然,自iOS 9以来,网络应用程序无法按预期工作(我相信);然而,我发现您可以用标签解决它:
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui">
<meta name="apple-mobile-app-capable" content="yes">
它为我工作,希望它也为您服务;)
你可以定义“*不正常*”吗?预期的行为是什么?会发生什么呢? –
你的问题是什么?目前还不清楚哪些是不起作用的。请具体说明。 –