Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) addFirstRowOfAlphaButtons
- {
- CGFloat leftAndRightMargin = 6;
- double totalWidthOfMargins = 108;
- CGFloat marginBetweenButtons = totalWidthOfMargins/9;
- double usableWidthSpaceForButtons = self.view.bounds.size.width - totalWidthOfMargins;
- CGFloat buttonWidth = usableWidthSpaceForButtons/10;
- CGFloat buttonHeight = 76;
- CGFloat distanceFromTopToRow1 = 22;
- UIButton *testButton1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- testButton1.frame = CGRectMake(leftAndRightMargin, distanceFromTopToRow1, buttonWidth, buttonHeight);
- testButton1.layer.masksToBounds = YES;
- testButton1.layer.cornerRadius = 7.0;
- testButton1.backgroundColor = [UIColor redColor];
- UIButton *testButton2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- testButton2.frame = CGRectMake(leftAndRightMargin+buttonWidth+marginBetweenButtons, distanceFromTopToRow1, buttonWidth, buttonHeight);
- testButton2.layer.masksToBounds = YES;
- testButton2.layer.cornerRadius = 7.0;
- testButton2.backgroundColor = [UIColor blueColor];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement