图片循环播放的效果

UIImage *image1 = [UIImage imageNamed:@"image1.png"];
UIImage *image2 = [UIImage imageNamed:@"image2.png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 150, 150)];
NSArray *array = [[NSArray alloc] initWithObjects:image1, image2, nil];
imageView.animationImages = array;
[imageView setAnimationRepeatCount:1000];
imageView.animationDuration = 5.0;
[self.view addSubview:imageView];
[imageView startAnimating];
[imageView release];
[array release];

 

你可能感兴趣的:(ios,iPhone)