As the name says, this is very strange, did you agree?
So, if someone found your codes
imageView.backgroundColor = [UIColor greenColor];
or
imageView.image = [UIImage imageName:@"angryBird"];"
does not work. Keep in mind that if your ImageView is animating or the animation is deleted or not.
---------- Answer below ---------------
Just stop the animation before setting the image and change the background of the animated UIImageView.
UIImageView* imageView = [UIImageView alloc] init]; //......do sth. like setFrame ... imageView.images = [NSArray arrayWithObjects....]; // set the animation images array imageView.animationDuration = 1.0; [imageView startAnimating]; //......do sth. [imageView stopAnimating]; // **** do not forget this!!!!! **** imageView.backgroundColor = [UIColor greenColor]; imageView.image = [UIImage imageName:@"angryBird"];
When you execute Selector: withObject: afterDey: 1.0s, you must also stopAnimating in the selector method and then setImage or change the background color.
source share