I have created a button in interface builder and set its type as custom. I want to change the background color of the button based on the button’s tag when the view loads. How can i do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Button added to Xib, tag set to 1.
View header:
In interface builder, bound myButton to button.
Then programmatically in viewDidLoad, conditionally set based on tag value: