Merge pull request #3043 from dreampiggy/fix_ios14_animated_image_static_render

Fix the issue that SDAnimatedImageView can not render static image on iOS 14.
This commit is contained in:
DreamPiggy 2020-06-23 21:20:56 +08:00 committed by GitHub
commit 15fb09afa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -466,6 +466,9 @@
- (void)displayLayer:(CALayer *)layer
{
UIImage *currentFrame = self.currentFrame;
if (!currentFrame) {
currentFrame = self.image;
}
if (currentFrame) {
layer.contentsScale = currentFrame.scale;
layer.contents = (__bridge id)currentFrame.CGImage;