3
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 中运行良好 bt 在 iOS 7 中不起作用。我在 nib 中制作了 UIImageView

4

1 回答 1

5

它应该可以工作,如果在延迟一段时间后不调用该方法,

        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];
    }
于 2013-09-25T07:05:16.653 回答