문제

Is there a way to freeze the last frame of my animation in my iphone app? Here's my code so far.

popup.animationImages = [NSArray arrayWithObjects:
                                 [UIImage imageNamed:@"picture1.png"],
                                 [UIImage imageNamed:@"picture2.png"],
                                 [UIImage imageNamed:@"picture3.png"],
                                 [UIImage imageNamed:@"picture4.png"],
                                 [UIImage imageNamed:@"picture5.png"],
                                 [UIImage imageNamed:@"picture6.png"],
                                 [UIImage imageNamed:@"picture7.png"], nil];
        popup.animationDuration = 1.750567;
        popup.animationRepeatCount = 1;
        [popup startAnimating];
        [self.view addSubview:popup];
도움이 되었습니까?

해결책

When animation stops UIImageView shows UIImage set in its image property. So you should just set it to the last frame of your animation:

popup.image =  [UIImage imageNamed:@"picture7.png"];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top