停止重新加载从iPhone Home Screen启动的Web应用程序 [英] Stop reloading of web app launched from iPhone Home Screen

查看:126
本文介绍了停止重新加载从iPhone Home Screen启动的Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网络应用并添加到我的iPhone主屏幕。当我切换到另一个应用程序并返回时,iPhone会自动重新加载我的网络应用程序。这打破了我的应用流程。

I created a web app and added to my iPhone Home Screen. When I switch to another app and back, iPhone automatically reload my web app. This breaks my app flow.

如何阻止iPhone重新加载应用程序?

How do I prevent iPhone from reloading the app?

我有apple-mobile-web-app-功能元标记已启用隐藏Safari工具栏,我不想将其关闭。

I have apple-mobile-web-app-capable meta tag enabled to hide Safari toolbar and I don't want to turn it off.

推荐答案

我刚发现此相关问题在SO上:停止本机网络应用程序重新加载自身在iOS上打开

I just found this related question on SO: Stop native web app from reloading itself upon opening on iOS

由于它似乎是Safari的限制,因此建议的解决方案是使用Javascript和HTML5 localStorage保持您的网络应用状态。启动Web应用程序后,检查持久状态并加载(如果可用)。

As it seems it's a limitation of Safari, a proposed solution is to persist your web apps state using Javascript and HTML5 localStorage. When your web app is launched, check for the persisted state and load it if available.

您可以在此处阅读有关在Safari中使用localStorage的信息: http: //developer.apple.com/library/safari/#documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007256-CH1-SW1

You can read about using localStorage in Safari here: http://developer.apple.com/library/safari/#documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007256-CH1-SW1

希望对您有所帮助。至少它对我有用,因为我和你有同样的问题。 : - )

Hope that helps you. At least it did for me, as I had the same problem as you. :-)

这篇关于停止重新加载从iPhone Home Screen启动的Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆