【发布时间】:2012-12-13 08:28:35
【问题描述】:
在过去的一个小时里,我一直在用头撞墙,试图让我的 scrollView 滚动,但无济于事。在viewDidLoad 我有
NSURL *url = [FlickrFetcher urlForPhoto:self.photoData format:FlickrPhotoFormatLarge];
NSData *imageRawData = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:imageRawData];
self.scrollView.delegate = self;
self.imageView.image = image;
self.scrollView.contentSize = image.size;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
我将 imageView 视图模式设置为左上角。
我的 UIScrollView 是通过选择我的 imageView,然后选择 Editor -> Embed in -> ScrollView 创建的。
还有什么我可以检查/尝试的吗?
【问题讨论】:
-
把scroll view的frame size作为你的图片尺寸,让contentSize大一点。
标签: objective-c uiscrollview ios6