使用动态图(GIF)


// 下载SDWebImage库  导入此头文件
spa

#import "UIImage+GIF.h"图片

#pragma mark - 动态图
- (void)loadingImageView {
    
    // 图片名
    NSString *name = @"LN.GIF";
    
    // 获取路径
    NSString *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]] pathForResource:name ofType:nil];
    
    // 转data
    NSData  *imageData = [NSData dataWithContentsOfFile:filePath];
    
    self.imageView.image = [UIImage sd_animatedGIFWithData:imageData];
    
}
it

相关文章
相关标签/搜索