我有个问题。我有这个代码缩放不起作用。
- (void)viewDidLoad {
UIImage *image = [UIImage imageNamed:@"zoomimage.jpeg"];
CGRect yFrame = CGRectMake(0.0, 0.0, 320, 432);
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, image.size.width, image.size.height)];
[imageView setImage:image];
scrollView = [[UIScrollView alloc] initWithFrame:yFrame];
[scrollView setScrollEnabled:YES];
[scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setContentSize:CGSizeMake(image.size.width, image.size.height)];
scrollView.minimumZoomScale = 0.4;
scrollView.maximumZoomScale = 4.0;
[scrollView setZoomScale:scrollView.minimumZoomScale];
[self.view addSubview:scrollView];
[self.view bringSubviewToFront:scrollView];
[scrollView addSubview:imageView];
}