How can I change the default color of the button on iPhone?
A common technique is to use an image for the background. Actually you can use a stretchable image:
- (void)viewDidLoad {
UIImage *blueImage = [UIImage imageNamed:@"blueButton.png"];
UIImage *blueButtonImage = [blueImage stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[myButton setBackgroundImage:blueButtonImage forState:UIControlStateHighlighted];
}
The original image:
The end result: