UIImage

2019-04-23  本文已影响0人  番茄红豆汤
    NSString  *name = @"loading.gif";
    NSString  *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]] pathForResource:name ofType:nil];
    NSData  *imageData = [NSData dataWithContentsOfFile:filePath];
    
    if (!self.loadingImageView) {
        self.loadingImageView = [[UIImageView alloc]init];
    }
    //    imgView.image = [UIImage animatedImageWithAnimatedGIFData:imageData];
    self.loadingImageView.backgroundColor = [UIColor clearColor];
    self.loadingImageView.image = [UIImage sd_animatedGIFWithData:imageData];
    self.loadingImageView.frame = CGRectMake(0, 0, 100, 250/2.0);
    [self.view addSubview:self.loadingImageView];
    [self.view bringSubviewToFront:self.loadingImageView];
上一篇下一篇

猜你喜欢

热点阅读