zoukankan      html  css  js  c++  java
  • SDWebImage4.0之后加载gif不显示的解决方案

    SDWebImage4.0之前

    1     UIImageView *imgView = [UIImageView new];
    2     imgView.contentMode = UIViewContentModeScaleAspectFit;
    3     imgView.frame = CGRectMake(0, 0, 100, 30);
    4     
    5     NSString  *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]]pathForResource:@"going" ofType:@"gif"];
    6     NSData  *imageData = [NSData dataWithContentsOfFile:filePath];
    7     imgView.backgroundColor = [UIColor clearColor];
    8     imgView.image = [UIImage sd_animatedGIFWithData:imageData];
    9     [self addSubview:imgView];

    SDWebImage4.0之后

    1     FLAnimatedImageView *imgView = [FLAnimatedImageView new];
    2     imgView.contentMode = UIViewContentModeScaleAspectFit;
    3     imgView.frame = CGRectMake(0, 0, 100, 30);
    4     NSString  *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] bundlePath]]pathForResource:@"going" ofType:@"gif"];
    5     NSData  *imageData = [NSData dataWithContentsOfFile:filePath];
    6     imgView.backgroundColor = [UIColor clearColor];
    7     imgView.animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
    8     [self addSubview:imgView];
  • 相关阅读:
    HDU4003 Find Metal Mineral
    POJ1125 Stockbroker Grapevine
    HDU4028The time of a day
    弱校ACM奋斗史
    POJ1236 Network of Schools
    HDU4004 The Frog's Games
    HDU4001 To Miss Our Children Time
    POJ2186 Popular Cows
    POJ1094 Sorting It All Out
    hadoop2.7.1单机和伪集群的搭建0
  • 原文地址:https://www.cnblogs.com/liuzhi20101016/p/11803942.html
Copyright © 2011-2022 走看看