NSArray *myImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"Image1.png"],
[UIImage imageNamed:@"Image2.png"],
[UIImage imageNamed:@"Image3.png"],
[UIImage imageNamed:@"mage4.gif"],
nil];
UIImageView *myAnimatedView = [UIImageView alloc];
[myAnimatedView initWithFrame:[self bounds]];
myAnimatedView.animationImages = myImages;
myAnimatedView.animationDuration = 0.35; // seconds
myAnimatedView.animationRepeatCount = 0; // 0 代表一直循环。
[myAnimatedView startAnimating];
[self addSubview:myAnimatedView];
[myAnimatedView release];