2010-03-02 62 views
1

有没有办法在我的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

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

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

你不知道你给我带来这个简单的答案有多开心。非常感谢你!! – NextRev 2010-03-02 15:39:44