Advertisement
Guest User

Mazyod ScrollViewTut p(1/2)

a guest
May 30th, 2012
2,940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)viewDidLoad
  2. {
  3.     [super viewDidLoad];
  4.    
  5.     [theScrollView setContentSize:CGSizeMake(3 * theScrollView.bounds.size.width, theScrollView.bounds.size.height)];
  6.     [theScrollView setPagingEnabled:YES];
  7.    
  8.     CGRect aFrame = theScrollView.bounds;
  9.    
  10.     UIView* view;
  11.     NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
  12.     view = [[UIView alloc] initWithFrame:aFrame];
  13.     [view setBackgroundColor:[UIColor blueColor]];
  14.     [theScrollView addSubview:view];
  15.    
  16.     aFrame = CGRectOffset(aFrame, theScrollView.bounds.size.width, 0);
  17.     NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
  18.     view = [[UIView alloc] initWithFrame:aFrame];
  19.     [view setBackgroundColor:[UIColor redColor]];
  20.     [theScrollView addSubview:view];
  21.        
  22.     aFrame = CGRectOffset(aFrame, theScrollView.bounds.size.width, 0);
  23.     NSLog(@"Frame: %@", NSStringFromCGRect(aFrame));
  24.     view = [[UIView alloc] initWithFrame:aFrame];
  25.     [view setBackgroundColor:[UIColor yellowColor]];
  26.     [theScrollView addSubview:view];
  27.    
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement