Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,235
126
how do i enable zooming in in UIScroll View, most examples and tutorials include a UIImageView, and i don't need that.


whats the simplest way to implement zooming in a scrollview?
 
Zooming on what.. You need to set contentsizes of the scrollview depending on what it is, etc.

just zooming in on the UIScroll View, because of i have a lot of details on there i want the user to zoom up if needed to but its just a UIscroll view with labels and textfields, I'm gonna also have a signature capturing module in there.

so i want them to zoom in so they can sign easier.



Code:
- (void)viewDidLoad
{
   
    [super viewDidLoad];
    
    scrollView.frame = CGRectMake (0, 0, 320, 460);
    [scrollView setContentSize:CGSizeMake(320, 600)];
    
}
 
heres my coding, can anyone tell me whats wrong with it?


when I try to zoom i get a sigbart error



Code:
- (void)viewDidLoad
{
    
    [scrollView setScrollEnabled:YES];
    scrollView.frame = CGRectMake (0, 0, 320, 460);
    [scrollView setContentSize:CGSizeMake(320, 600)];
    [scrollView setMaximumZoomScale:4];
    [scrollView setMinimumZoomScale:1];
    self.scrollView.delegate=self;
    
    
    
}



- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return scrollView;  // i get an error here I've tried declaring my scollview as scrollvieww, same result so i don't know if thats important.
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.