I changed a button color using the following code:
[self.testButton setBackgroundColor:[UIColor redColor]];
but I got a weird button:

why the button background color didn’t change?
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.
You can import
#import <QuartzCore/QuartzCore.h>and try this,Or else you can use some custom image as the background image for this button.