Fix the issue that SDAnimatedImageView can not render static image on iOS 14.

UIKit some internal behavior changes and we should always update the render layer if we have no `currentFrame`
This commit is contained in:
DreamPiggy 2020-06-23 16:01:42 +08:00
parent 5818cf70fd
commit bb7b1914e6
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;