iOS:fix iOS 14 cannot display image

This commit is contained in:
pengfei.zhou 2020-09-18 16:58:19 +08:00 committed by osborn
parent b9b0ce22b2
commit 171e96d0b5

View File

@ -30,6 +30,17 @@ @interface DoricImageView : YYAnimatedImageView
@end
@implementation DoricImageView
- (void)displayLayer:(CALayer *)layer {
if (@available(iOS 14.0, *)) {
if (self.isAnimating) {
[super displayLayer:layer];
} else {
layer.contents = (__bridge id) self.image.CGImage;
};
} else {
[super displayLayer:layer];
}
}
@end
@interface DoricImageNode ()