【发布时间】:2012-06-22 14:32:40
【问题描述】:
我有幻灯片,我想显示大图像,我添加到[NSOperation mainQueue] 低优先级操作,此操作显示图像。
如果图像很小,一切正常,但是当图像大约 5Mb 时,视图会冻结 1 秒,并且我无法滚动幻灯片。我认为,对于 iPhone 来说,显示大图像非常困难,主队列太超载了。
但我不明白,因为我所有的显示代码都是在低优先级操作中执行的。
这是显示代码。
[imageView removeFromSuperview];
imageView = nil;
// reset our zoomScale to 1.0 before doing any further calculations
self.zoomScale = 1.0;
// make a new UIImageView for the new image
self.imageView = [[[UIImageView alloc] initWithImage:image] autorelease];
[self addSubview:imageView];
self.contentSize = [image size];
[self setMaxMinZoomScalesForCurrentBounds];
self.zoomScale = self.minimumZoomScale;
也许我可以设置手势识别器的优先级(UIScrollView 的常规问题识别器?)
更新
请看我的新话题,我把问题描述的更恰当my topik
【问题讨论】:
标签: iphone ios uiimage nsoperation nsoperationqueue