0

私は以下のコードを使用しています

    UIImageView* campFireView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 175, 175)];
     // load all the frames of our animation
     campFireView.animationImages = [NSArray arrayWithObjects:
                                     [UIImage imageNamed:@"a1.png"],
                                     [UIImage imageNamed:@"a2.png"],
                                     [UIImage imageNamed:@"a3.png"],
                                     [UIImage imageNamed:@"a4.png"],
                                     [UIImage imageNamed:@"a5.png"],
                                     [UIImage imageNamed:@"a6.png"],
                                     [UIImage imageNamed:@"a7.png"],
                                     [UIImage imageNamed:@"a8.png"],
                                     [UIImage imageNamed:@"a9.png"],
                                     [UIImage imageNamed:@"a10.png"],
                                     nil];

     // all frames will execute in 1.75 seconds
     campFireView.animationDuration = 0.75;
     // repeat the annimation forever
     campFireView.animationRepeatCount = 0;
     // start animating
     [campFireView startAnimating];
     // add the animation view to the main window 
     [self.view addSubview:campFireView];   //  [campFireView release];

これはa1からa10でうまく機能しますが、どうすれば逆の順序で移動し続けることができますか?それで、a1からa10からa1を継続的にアニメーション化する必要がありますか?

4

1 に答える 1

1
campFireView.animationImages = [NSArray arrayWithObjects:
                                [UIImage imageNamed:@"a1.png"],
                                [UIImage imageNamed:@"a2.png"],
                                [UIImage imageNamed:@"a3.png"],
                                [UIImage imageNamed:@"a4.png"],
                                [UIImage imageNamed:@"a5.png"],
                                [UIImage imageNamed:@"a6.png"],
                                [UIImage imageNamed:@"a7.png"],
                                [UIImage imageNamed:@"a8.png"],
                                [UIImage imageNamed:@"a9.png"],
                                [UIImage imageNamed:@"a10.png"],
                                [UIImage imageNamed:@"a9.png"],
                                [UIImage imageNamed:@"a8.png"],
                                [UIImage imageNamed:@"a7.png"],
                                [UIImage imageNamed:@"a6.png"],
                                [UIImage imageNamed:@"a5.png"],
                                [UIImage imageNamed:@"a4.png"],
                                [UIImage imageNamed:@"a3.png"],
                                [UIImage imageNamed:@"a2.png"],
                                [UIImage imageNamed:@"a1.png"],
                                nil];
于 2013-03-09T11:20:25.667 に答える