我做错了什么?下面是我如何创建并填充我的scrollView
-(void)viewDidAppear:(BOOL)animated {
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bigimage.jpg"]];
imgView.contentMode = UIViewContentModeScaleAspectFit;
scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
scrollView.contentSize = imgView.frame.size;
scrollView.minimumZoomScale = scrollView.frame.size.width / scrollView.contentSize.width * 0.99;
scrollView.maximumZoomScale = 2;
[self.view addSubview:scrollView];
[scrollView addSubview:imgView];
[scrollView setZoomScale:0.5 animated:YES];
NSLog(@"current zoomScale: %f", scrollView.zoomScale);
[imgView release];
}
NSLogged zoomScale为1.0,图像以全尺寸清晰显示。“收缩缩放”不起任何作用。
我已经尝试了几乎所有我能在网上找到的东西,但每个人似乎都在做这件事,而且对他们有效。
非常感谢您的帮助!