问题的标题不言自明。为了获得更多帮助,我想告诉您,我的应用程序是使用 Apple Photo Scroller(Apple 的 PhotoScroller 示例代码的修改以在 UIViewController 子类中加载 UIPageViewController )开发的,具有多个图像库。问题是 ipad2 上的捏合缩放功能完美,但在视网膜 iPad 上却没有。我的图像大小为 2048x1536。
谁能告诉我为什么变焦在视网膜 iPad 上不起作用?
问题的标题不言自明。为了获得更多帮助,我想告诉您,我的应用程序是使用 Apple Photo Scroller(Apple 的 PhotoScroller 示例代码的修改以在 UIViewController 子类中加载 UIPageViewController )开发的,具有多个图像库。问题是 ipad2 上的捏合缩放功能完美,但在视网膜 iPad 上却没有。我的图像大小为 2048x1536。
谁能告诉我为什么变焦在视网膜 iPad 上不起作用?
我将首先检查contentScaleFactor
是否设置为 1。
来自 PhotoScroller 的 TilingView.m 文件:
// to handle the interaction between CATiledLayer and high resolution screens, we need to
// always keep the tiling view's contentScaleFactor at 1.0. UIKit will try to set it back
// to 2.0 on retina displays, which is the right call in most cases, but since we're backed
// by a CATiledLayer it will actually cause us to load the wrong sized tiles.
//
- (void)setContentScaleFactor:(CGFloat)contentScaleFactor
{
[super setContentScaleFactor:1.f];
}