Button animation using images

I have a UIButton that has a view arrow of a blue image set as

     UIImage *arrowImage = [UIImage imageNamed:@"bluearrow.png"];
    [self.prevbutton setBackgroundImage:arrowImage forState:UIControlStateNormal];

Now I have another yellow.png image that I want to super superimpose on top of that button image and blink constantly. How can i do this?

+3
source share
1 answer

This will help you.

myButton.imageView.animationImages =
[NSArray arrayWithObjects:[UIImage imageNamed:@"image1.png"],
                          [UIImage imageNamed:@"image2.png"],
                          nil];
myButton.imageView.animationDuration = 0.5; //whatever you want (in seconds)
[myButton.imageView startAnimating];

As stated in fooobar.com/questions/322625 / ...

+4
source

All Articles