Image with resizeMode=contain blinks on rerender (Android)
See original GitHub issueHey guys,
I’m trying to change the image of a button based on if the button is selected or not. However if the image has resizeMode set to ‘contain’, the image always blinks before changing. Other resizeModes do not blink. The image sources are local, included with require.
Here’s a barebones render method that should reproduce the issue:
render() {
var source = this.props.isSelected ? require('./image1.png') : require('./image2.png')
return (
<TouchableNativeFeedback>
<View>
<Image style={{resizeMode: 'contain'}} source={source} />
</View>
</TouchableNativeFeedback>
)
}
I’m using rn0.22.2 for Android, developing on a Mac. The issue occurs on both device and simulator, with debug mode both on and off.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
resizeMode="contain" makes my images blinking on changin ...
I'm using resizeMode="contain" for my images and when I change view or update state they keep blinking on android devices. if I change...
Read more >Image with resizeMode=contain blinks on rerender (Android)
Image with resizeMode=contain blinks on rerender (Android). mkonicek. Moved from https://github.com/facebook/react-native/issues/6971.
Read more >5 Things to know about Images in React Native - Medium
You really need the image to be present locally in order to avoid any flickering effect when loading it. It also allows to...
Read more >expo-splash-screen - npm
By using this resize mode your app will will leverage Android's ability to present a static bitmap while the application is starting up....
Read more >Pains with FlatList re-rendering and causing images to re-load ...
includes( // prevProps.item.SK //) //Returning true, but I still have a refresh. return true; };. My item, which consists of a header, body...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any update on this, I am using react-native 0.43.4, issue still persists. Image with
resizeMode='contain'
flickers upon re-render in android.I have the same problem, it only works when I set the height and width manually and directly. RN@0.51.1 on Android