UIScrollView Zooming - Can't get it to work?

Hello,
I've been having great success with the iPhone SDK but for some reason I just can't get the zooming to work with a UIScrollView. I've implemented the delegate but the methods are never being fired.. but scrolling works fine. What gives?
Thanks

When you create your scrollview..
scrollView.delegate = self; //(or what ever class is you delegate)
And setup scrolling by changing these values, read the docs for more info.
scrollView.minimumZoomScale = 0.5;
scrollView.maximumZoomScale = 2.0;
Add this function to your delegate class
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return myView; //(The view you want to scroll)
I think you need to add UIScrollViewDelegate to your interface line but i don't remember if I did this for scroll or zoom.
@interface AppDelegate : NSObject <UIApplicationDelegate,UIScrollViewDelegate> {

Similar Messages

Maybe you are looking for