1
我真的有最基本的代码,我很疲惫,为什么它不会放大:为什么我无法缩放嵌入在UIScrollView中的UIImageView?
- (void)viewDidLoad
{
[super viewDidLoad];
self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth([UIScreen mainScreen].bounds), CGRectGetHeight([UIScreen mainScreen].bounds))];
self.scrollView.delegate = self;
self.scrollView.contentSize = self.imageView.bounds.size;
self.scrollView.minimumZoomScale = 0.5;
self.scrollView.maximumZoomScale = 10.0;
[self.view addSubview:self.scrollView];
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"community1.jpeg"]];
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.scrollView addSubview:self.imageView];
}
在模拟器我尝试放大和什么都没有发生。如果这是相关的,这是一个相当大的图像。