Is there a way to animate a UIButton background image view with a set of images?
I’ve managed to do so with the imageView property, but couldn’t find an equivalent background property.
10x
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.
To change a buttons backround image, or text for that matter – you need to change it for the particular UIControlState… i.e Highlighted, Selected, Disabled
Use
- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)stateI’m not sure if you can animate them, I’ve never tried. If you can’t animate them, then you could put a UIImageView behind a transparent button and animate the images in that instead – just a thought.