UIScrollView

January 22, 2014   ·   0 Comments


self.view.backgroundColor = [UIColor redColor];
UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
scroll.pagingEnabled = YES;

  = 3;
    for (int i = 0; i < numberOfViews; i++) {
        CGFloat yOrigin = i * self.view.frame.size.height;
        
        UIView *awesomeView = [[UIView alloc] initWithFrame:CGRectMake(0,yOrigin,  self.view.frame.size.width, self.view.frame.size.height)];
        
        awesomeView.backgroundColor = [UIColor colorWithRed:0.5/i green:0.5 blue:0.5 alpha:1];
        [scroll addSubview:awesomeView];
      //  [awesomeView release];
    }
    scroll.contentSize = CGSizeMake(self.view.frame.size.width , self.view.frame.size.height* numberOfViews);
   [self.view addSubview:scroll];
    



Screen Shot 2014-01-21 at 5.33.29 PM

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
iOS Tutorial9

Amazon

adsbygoogle

Recent Posts

Categories

Amazon