美文网首页
UIImageView 轮播一组图片

UIImageView 轮播一组图片

作者: 会飞的大西瓜v | 来源:发表于2018-12-07 11:22 被阅读7次
    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];
    

    相关文章

      网友评论

          本文标题:UIImageView 轮播一组图片

          本文链接:https://www.haomeiwen.com/subject/mrxthqtx.html