comment faire un zoom de l'image xcode??

j'ai un problème. J'ai ce code d'un zoom ne fonctionne pas.

- (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];

}

  • Il est temps d'étudier apple est la source de l'échantillon codes copain
InformationsquelleAutor user1498513 | 2012-07-23