How do you set a button as highlighted on iPhone
How do you set an iPhone UIButton to the selected state开发者_高级运维, i.e. where it is blue highlighted?
I'd recommend for simple questions like this you start by looking at the documentation provided by apple. Every class has a reference document which should be your first port of call.
UIButton
Granted UIButton's documentation does not actually cover the selected
property but that is where you check the documentation for the classes it inherits from.
Inherits from UIControl : UIView : UIResponder : NSObject
And in this case it is UIControl that has the property you are looking for.
myButton.selected = YES;
精彩评论