移动野生动物园与主屏幕webapp [英] Mobile safari vs home-screen webapp

查看:130
本文介绍了移动野生动物园与主屏幕webapp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iOS开发一个webapp,我注意到在手机游戏和从主屏幕上运行之间有一些奇怪的事情。

I am developing a webapp for iOS, and I've noticed some weird things between running on mobile safari and running from the homescreen.

有没有任何为这些模式之间提供通用接口的资源?

如果没有,是否有任何资源详细说明所有差异和陷阱在两种模式之间?

我遇到的事情:

长轮询是有点奇怪。请参见此示例

Long-polling is kinda weird. See this example.

window.innerWidth & window.innerHeight 不一致。

window.innerWidth & window.innerHeight are inconsistent.


  • 移动Safari-垂直方向按预期工作,水平不是


    • 垂直


      • width- 768

      • height- 946


      • width-769 ??

      • height- 518 ??


      • 垂直


        • width-768

        • height- 1004


        • width- 1024

        • height- 748

        其他内容:

        我发现这个这个很有意思。

        这个问题也揭示了一些奇怪的行为。

        This question also sheds some light on weird behaviors.

        推荐答案

        我认为Apple没有公开记录iOS中全屏网页应用的属性,所以你发现的任何内容都可能是轶事,因此不够可靠依赖在我身上n未来版本。

        I don't think Apple has publicly documented the attributes of the full screen web apps in iOS, so anything you find may be anecdotal, and therefore not reliable enough to depend on in future releases.

        您可能会更好地构建一个只有UIWebView渲染您的Web应用程序的应用程序。 iOS应用程序的视图模式已明确定义并有详细记录,应用程序可以提供将来可能需要的其他功能(例如本地通知,后台执行,自定义URL处理程序)。

        You may have better luck building an application which has just a UIWebView rendering your web app. The view modes for iOS applications are clearly defined and well documented, and the application can provide other features you may need in the future (such as local notifications, background execution, custom URL handlers).

        这篇关于移动野生动物园与主屏幕webapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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