skip to main |
skip to sidebar
iPhone SDK Tips & Tricks
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
myButton.frame = CGRectMake(200, 30, 100, 90); // size and position of button
[myButton setBackgroundImage:[UIImage imageNamed:@"blue_bars.png"] forState:UIControlStateNormal];
[myButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[myButton setTitle:@"Call Us\nNow" forState:UIControlStateNormal];
myButton.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
myButton.titleLabel.textAlignment = UITextAlignmentCenter;
myButton.titleLabel.font = [UIFont boldSystemFontOfSize:22];
myButton.backgroundColor = [UIColor clearColor];