From b6ded7261544c703e82e8dbfa442dad4b201d428 Mon Sep 17 00:00:00 2001 From: Tom Cheung Date: Sun, 19 Jul 2020 21:33:10 -0700 Subject: [PATCH] Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js ``` It may also need to test gif image is render correctly ```js ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 --- Libraries/Image/RCTUIImageViewAnimated.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/Image/RCTUIImageViewAnimated.m b/Libraries/Image/RCTUIImageViewAnimated.m index af4becd431..55bc2c8d66 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.m +++ b/Libraries/Image/RCTUIImageViewAnimated.m @@ -275,6 +275,8 @@ static NSUInteger RCTDeviceFreeMemory() { if (_currentFrame) { layer.contentsScale = self.animatedImageScale; layer.contents = (__bridge id)_currentFrame.CGImage; + } else { + [super displayLayer:layer]; } }