Skip to content
Permalink
Browse files
Fix image cannot show in iOS 14 (#29420)
Summary:
This PR is to fix #29279, which image cannot show in iOS 14
As #29279 (comment) 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: #29420

Test Plan:
Image can be shown in iOS 14 build with Xcode 12 beta, using
```js
<Image source={require('./images/some_local_image.jpg')}/>
```

It may also need to test gif image is render correctly
```js
<Image source={{uri: 'https://some_remote_gif_image.gif'}}/>
```

Reviewed By: p-sun

Differential Revision: D22619448

Pulled By: shergin

fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2
  • Loading branch information
Tom Cheung authored and facebook-github-bot committed Jul 20, 2020
1 parent b78d705 commit 123423c2a9258c9af25ca9bffe1f10c42a176bf3
Showing 1 changed file with 2 additions and 0 deletions.
@@ -285,6 +285,8 @@ - (void)displayLayer:(CALayer *)layer
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer];
}
}

2 comments on commit 123423c

@KamalGangwar
Copy link

@KamalGangwar KamalGangwar commented on 123423c Nov 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working...

@liqiankl
Copy link

@liqiankl liqiankl commented on 123423c Jan 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch doesn't work

Please sign in to comment.