AllImageScrollView = [[UIScrollView alloc] initWithFrame: CGRectMake (0, 0,768,102 4)];
AllImageScrollView. minimumZoomScale = 0.3;
AllImageScrollView. maximumZoomScale = 1.0;
AllImageScrollView. backgroundColor = [UIColor clearColor];
AllImageScrollView. delegate = self;
[Self. view addSubview: allImageScrollView];
MPicStatusesViewController = [[PicStatusesViewController alloc] init];
[AllImageScrollView addSubview: mPicStatusesViewController. view];
// UIScrollView Delegete implementation
-(UIView *) viewForZoomingInScrollView :( UIScrollView *) scrollView
{
Return mPicStatusesViewController. view; // return the view to be scaled added on the ScrollView.
}
-(Void) scrollViewDidZoom :( UIScrollView *) scrollView
{
// Scaling operation called
}
-(Void) scrollViewDidEndZooming :( UIScrollView *) scrollView withView :( UIView *) view atScale :( float) scale
{
// Called after scaling
}
Address: http://ios-iphone.diandian.com/post/2011-09-15/5066984