【问题标题】:Freeze last frame of animation?冻结动画的最后一帧?
【发布时间】:2010-03-02 05:03:31
【问题描述】:

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

【问题讨论】:

    标签: iphone animation sdk freeze imageview


    【解决方案1】:

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

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

    【讨论】:

    • 你不知道这个简单的答案让我多么高兴。非常感谢!!
    猜你喜欢
    • 1970-01-01
    • 2016-08-03
    • 2014-12-16
    • 2011-03-27
    • 2013-10-30
    • 1970-01-01
    • 2017-05-02
    • 2021-08-10
    • 1970-01-01
    相关资源
    最近更新 更多