我在我的 ios 应用程序中使用 photoswipe 3.0.5。在模拟器(ios 6.1)中一切正常,但是当我在我的真实设备(ios4.3)上运行应用程序并且我从纵向旋转到横向,反之亦然,uiwebview 正确旋转但图像没有。
这似乎是一个常见问题,事实上 photoswipe 的 github 页面(https://github.com/codecomputerlove/PhotoSwipe)说:
Work around for issue #141 now officially added - when rotating an app with PhotoSwipe displayed in a UIWebView, PhotoSwipe does not rotate. This seems to be an issue with UIWebView not PhotoSwipe. To enable this work around, set "enableUIWebViewRepositionTimeout = true" when creating your PhotoSwipe instance. You can also specify the frequency of this timeout by setting "uiWebViewResetPositionDelay" (default 500ms) - Please Note This is not needed for PhoneGap apps, nor web apps added to your homescreen.
但我不知道在哪里添加那行代码。谁能帮我一把?
这种“变通”真的有用吗?我问这个问题是因为模拟器上一切正常。