revealImgView.animationImages =[NSArray arrayWithObjects:[UIImage imageNamed:@"reveal1.png"],[UIImage imageNamed:@"reveal2.png"],[UIImage imageNamed:@"reveal3.png"],[UIImage imageNamed:@"reveal4.png"],[UIImage imageNamed:@"reveal5.png"],nil];
revealImgView.animationDuration=1.5;
revealImgView.animationRepeatCount=INFINITY;
[revealImgView startAnimating];
这在 iOS 6 中运行良好但在 iOS 7 中不起作用。我已经在 nib 中制作了 UIImageView
最佳答案
它应该可以工作,如果在一段时间后没有调用该方法,
double delayInSeconds = 0.5;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self getAllImgViewAnimating];
});
-(void)getAllImgViewAnimating
{
revealImgView.animationImages =[NSArray arrayWithObjects:[UIImage imageNamed:@"reveal1.png"],[UIImage imageNamed:@"reveal2.png"],[UIImage imageNamed:@"reveal3.png"],[UIImage imageNamed:@"reveal4.png"],[UIImage imageNamed:@"reveal5.png"],nil];
revealImgView.animationDuration=1.5;
revealImgView.animationRepeatCount=INFINITY;
[revealImgView startAnimating];
}
关于iphone - UIImageview 在 iOS7 中没有动画,但在 iOS6 中运行良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18997411/