我从网上下载了动画篝火。我的图像序列是“*.png”,我无法让它工作。它一直循环到最后。它不显示图像。为什么我不能为这段代码制作动画?我做错了什么?
UIImageView* campFireView = [[UIImageView alloc] initWithFrame:screenx.frame];
int j;
int i;
for (j = 1, i = 0; i < 28; i =1)
{
NSLog( @"%i.png", i);
campFireView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:[NSString stringWithFormat:@"%i.png",i]], nil];
}
// all frames will execute in 1.75 seconds
campFireView.animationDuration = .15;
// repeat the annimation forever
campFireView.animationRepeatCount = 1;
// start animatinganimationRepeatCount:1];
[campFireView startAnimating];
// add the animation view to the main window
[self.view addSubview:campFireView];
[campFireView release];