Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)loadView
- {
- UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
- view.backgroundColor = [UIColor lightGrayColor];
- view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- int numberOfbuttons = 2;
- CGFloat buttonsLegth = (-20+view.bounds.size.width)/numberOfbuttons-20;
- for(int i=0;i<numberOfbuttons;i++){
- CGRect buttonFrame = CGRectMake(0, 0, buttonsLegth, 37);
- buttonFrame.origin.x = (buttonFrame.size.width+20)*i + 20.0;
- buttonFrame.origin.y = 20.0;
- UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // Autoreleased
- button.frame = buttonFrame;
- [button setTitle:@"Done" forState:UIControlStateNormal];
- [view addSubview:button];
- }
- self.view = view;
- [view release];
- }
Add Comment
Please, Sign In to add comment