我有两个不同的图像,它们本质上只是彼此的倒数。我想来回动画它们以创建一些移动的效果。在 AppDelegate didFinishLaunching 我有:
myImageWalk = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 568)];
[self.myImageWalk setImage: [self loadingImage]];
[window addSubview:myImageWalk];
[window bringSubviewToFront:myImageWalk];
然后,同样在 App Delegate 中,我有:
-(UIImage*)loadingImage
{
NSArray *animationFrames = [NSArray arrayWithObjects:
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
[UIImage imageNamed:@"original.png"],
[UIImage imageNamed:@"second.png"],
nil];
return [UIImage animatedImageWithImages:animationFrames duration:6.0f];
}
但是,什么都没有发生,没有图像出现。我究竟做错了什么?