冻结动画的最后一帧?

时间:2010-03-02 05:03:32

标签: iphone animation sdk freeze imageview

有没有办法在我的iphone应用程序中冻结动画的最后一帧?到目前为止,这是我的代码。

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

1 个答案:

答案 0 :(得分:1)

当动画停止时,UIImageView会在其image属性中显示UIImage设置。所以你应该将它设置为动画的最后一帧:

popup.image =  [UIImage imageNamed:@"picture7.png"];