iPhone Buttons Question
Once I tap the button, its default highlight color is blue. How can you change the highlight co开发者_运维百科lor of a button. Either in interface builder or by code.
In IB when you select the Button Attributes of your UIButton choose "Highlighted State Configuration" (instead of "Default State Configuration") and select an image for the Background.
Or in code: [myButton setBackgroundImage:[UIImage imageNamed:@"imagename"] forState:UIControlStateHighlighted];
So you rather set an image, than set a color.
You might want to look into code examples of creating your custom UIButton ([UIButton buttonWithType:UIButtonTypeCustom]
), using UIImage's stretchableImageWithLeftCapWidth:topCapHeight:
instance method.
精彩评论