views:

385

answers:

1

I have several UIImage subviews in one UIScrollView. I'm trying to emulate iPhones's Photos app. To enable pinch zooming, I have implemented UIScrollViewDelegate and the one thing I'm unable to figure out is this delegate function:

  • (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;

How do I find out which UIImage subview is currently active?

Something like:

  • (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{ return activeUIImageViewSubView; }
A: 

You probably want to keep track yourself of the current UIImage subview.

Or if you have only one visible at a time, look for the one with the coordinate values that make it visible.

If you want to zoom them all at the same time, you may want to group all your UIImage in an intermediate UIView that could be scrolled and panned.

prossel