NSArray *myImages = [NSArray arrayWithObjects: 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]; |