ibireme/YYImage

iOS 14 YYAnimatedImageView加载图片失败

gityoung opened this issue · 13 comments

iOS 14 YYAnimatedImageView加载图片失败 除了 gif 什么都加载不出来

  • (void)displayLayer:(CALayer *)layer {

    if (_curFrame) {

      layer.contents = (__bridge id)_curFrame.CGImage;
    

    }else{

      if (@available(iOS 14.0, *)) {
    
          [super displayLayer:layer];
    
      }
    

    }

}

xfdev commented

see #149

我也是刚刚发现的ios 14有问题

请问这个我们code 已经修复了吗 还是要自己去改?

YYImage 使用下面这个仓库就行了
pod 'YYImage', :git => 'https://github.com/QiuYeHong90/YYImage.git'

这个仓库已经修正了这个兼容问题,亲测有效。

Lyfei commented

库看起来是不会维护了。直接从pod里改源码不如从pod移出来拖到项目里,当自己轮子改了

Notice: it doesn't include WebP subspec by default, if you want to support WebP format, you may add pod 'YYImage/WebP' to your Podfile.

Lyfei commented
  • (void)displayLayer:(CALayer *)layer {
    if (_curFrame) {

      layer.contents = (__bridge id)_curFrame.CGImage;
    

    }else{

      if (@available(iOS 14.0, *)) {
    
          [super displayLayer:layer];
    
      }
    

    }

}

我通过xcode直接安装到手机上的,在iOS 14才会出现这个问题,然后按你的改了有效果。奇怪的是,我旧版的app运行在iOS 14上没问题,库没变,这是为啥呢

同样问题 UIImageView 继承 YYAnimatedImageView用来支持动图,iOS14.4导致图片无法显示

同样问题 UIImageView 继承 YYAnimatedImageView用来支持动图,iOS14.4导致图片无法显示