views:

20

answers:

1

Dear Friends,

I am trying to create a small game for the iPhone with images and I want to them to zoom in when the player is pinching on the screen. I have seen the tutorials with one UIImageView. However, now that I am using multiple UIImageViews, things do not work OK.

I put them in an UIView and I am trying to zoom the UIView. However things are not scaling inside the screen when I run the simulator.

I use the following code

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
    return containerView; //containerView is the UIView containing all the UIIMageviews
}

-(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
    [containerView setTransform:CGAffineTransformIdentity];
    containerView.contentScaleFactor = scale;
}

Any suggestions? Thanx!

A: 

Have a look at the ScrollViewSuite sample on the apple developer site, that has a working example of what I think you're trying to do.

(I think I got the name right, the developer site is down for updates just now so I can't give you a link.)

JosephH