简体   繁体   中英

Change UIButton state programmatically

I am trying to change a UIButton's state programmatically, so that when i tap it, the background stays blue. I can change the enabled property and that works, but changing selected or highlighted doesnt affect the state.

Is this possible?

Thanks

您可以随时使用ivar独立于按钮跟踪您自己的状态,然后更改按钮的背景以适应状态。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM