开发者

How do you set a button as highlighted on iPhone

开发者 https://www.devze.com 2023-01-18 04:40 出处:网络
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 provid

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号