Zooming In UIScrollView

Discussion in 'iOS Programming' started by loon3y, Oct 27, 2011.

  1. loon3y macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #1
    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?
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Zooming on what.. You need to set contentsizes of the scrollview depending on what it is, etc.
     
  3. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #3
    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)];
        
    }
    
    
     
  4. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #4
    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.
    }
    
    
    
    
    
    
     
  5. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #5

Share This Page