self.activityImageView = [[UIImageView alloc] initWithFrame:CGRectMake(PHONE_WIDTH / 2 - 75, PHONE_HEIGHT / 2 - 75, 150, 150)];
self.activityImageView.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.activityImageView];
NSMutableArray *images = [[NSMutableArray alloc] initWithCapacity:3];
for (int i = 1; i <= 3; i ++) {
NSString *imageName = [NSString stringWithFormat:@"loading%d",i];
UIImage *image = [UIImage imageNamed:imageName];
[images addObject:image];
}
self.activityImageView.animationImages = images;
self.activityImageView.animationDuration = 0.8;
[self.activityImageView startAnimating];
[NSTimer scheduledTimerWithTimeInterval:15 target:self selector:@selector(destructionActivityImageView) userInfo:nil repeats:NO];
网友评论