iOS
iOS

Reputation: 213

UIImageview is not animating in iOS7 but working good in iOS6

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];

This is working good in iOS 6 bt not working in iOS 7. i have made the UIImageView in nib

Upvotes: 3

Views: 2065

Answers (1)

Vivek Sehrawat
Vivek Sehrawat

Reputation: 6570

It should work and if not call the method after some delay,

        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];
    }

Upvotes: 5

Related Questions