Fixed an issue where playing an animated photo with YYWebImage could not stay on the last frame.
This commit is contained in:
parent
44135ebf26
commit
4e2b4d051b
@ -37,11 +37,12 @@ @interface DoricImageView : YYAnimatedImageView
|
|||||||
@implementation DoricImageView
|
@implementation DoricImageView
|
||||||
- (void)displayLayer:(CALayer *)layer {
|
- (void)displayLayer:(CALayer *)layer {
|
||||||
if (@available(iOS 14.0, *)) {
|
if (@available(iOS 14.0, *)) {
|
||||||
if (self.isAnimating) {
|
if ([self.image isKindOfClass:YYImage.class]
|
||||||
|
&& ((YYImage *) self.image).animatedImageData) {
|
||||||
[super displayLayer:layer];
|
[super displayLayer:layer];
|
||||||
} else {
|
} else {
|
||||||
layer.contents = (__bridge id) self.image.CGImage;
|
layer.contents = (__bridge id) self.image.CGImage;
|
||||||
};
|
}
|
||||||
} else {
|
} else {
|
||||||
[super displayLayer:layer];
|
[super displayLayer:layer];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user