开发者

iPhone SDK: Two animation sequences playing at random *help*

I have two animation sequences, and I want one of them to play randomly when a button is pressed. Here is the code:

{

    color.animationImages = [NSArray arrayWithObjects:
                        [UIImage imageName: @"1.gif"],
                        [UIImage imageName: @"2.gif"],
                        [UIImage imageName: @"3.g开发者_运维技巧if"],
                        [UIImage imageName: @"4.gif"],
                        [UIImage imageName: @"5.gif"],
                        [UIImage imageName: @"6.gif"],
                        [UIImage imageName: @"7.gif"], nil];
    [color setAnimationRepeatCount:0];
    color.animationDuration = 3;
    [color startAnimation];

}

I don't know how to do the code for this. So if anyone knows please tell me! Thank you!


I think the problem is with your images. Do you have the set of images in one .gif file. If yes then please save all these seven images explicitly with .png or any other image format. Then your code will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜