I have a UIButton
which I've added in IB, however the view behind this button changes color and I need to switch the button's type between InfoDark and InfoLight. Bizarrely though, buttonType
property is read only. So how can i switch between light and dark info buttons?
You can't set buttonType readonly property, use below may help:
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
There's no way to change the .buttonType
once it's set.
You can prepare two buttons, and hide one of them depending on the background color.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With