- (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