[Image] White flickering when changing image
Hi,
I just updated from RN 0.8 to the current master and I'm seeing the following behaviour.
I'm showing images from the local UserDefaultsDirectory and when loading such an image, I see a very fast white flickering (I think while loading the image). This was not the case in RN 0.8. I know that the loading happens async and thus, loading times might occur. But is there any option to not have this white flickering - knowing that perhaps for 1 or 2 FPS, the view is not updated (I would prefer having the old content shown for another 1 or 2 FPS than having old content -> white screen -> new content).
My background is the following: I'm having a card which I "flip" via the Animated API. After the animation is done, I actually have to re-render the screen as otherwise, Touchable buttons are not working correctly (due to still being on the "wrong side" of the card). And while re-rendering, I get a white flickering on the position of the image (although the actual image is the same all the time, I'm rendering it in another Image component that is on the other side of the card).
Thanks Philipp
I encountered flickering when switching between tabs when upgrading from 0.9 to master as well. It may have to do with an optimization that removes off-screen images cc @a2
Did anyone find a workaround for this?
I see flickering when doing navigator.push to a new view. The images on the previous screen flicker once as the new view slides from the right. Any ideas how to fix this? My issue posted here: https://github.com/facebook/react-native/issues/3187
@a2 Do you have any idea here?
I can notice a similar behavior as described by @PhilippKrone
I have image flickering when doing tab switching in TabBarIOS on 0.15, any fix yet?
I'm using the images for background purposes and when switching to a new scene using the navigator, it starts rendering the image mid transition. This is unfortunate, and I wouldn't mind waiting 1-2 frames for the transition to start too.
I think it would be better to at least fade in the images.
I wonder if the problem I'm having is related to this issue. Is there any successful workaround?
Thanks!
This thread is closed in favour of #4869 and #4869 is closed in favour of this thread!
This is definitely an issue, I'm experiencing it with switching to any page in NavigatorIOS or Tab bar IOS and back to a page with a background image.
I'd like to note that resizeMode being set to 'cover' instead of 'contain' solved one flickering issue when the assets were being loaded for a second time.
However, I experience a flicker when switching between two images, on first load. I expect this is because the image is being decoded on the fly, can anyone think of a way we can decode assets before they are being rendered, so the user won't experience a flash?
I'm experiencing flickering on rendering the same image. It re-renders when selected the image does not change. The previously selected image becomes deselected but also does not change image. Every time the image is deselected, it flickers, even though its position has not changed and the image is the same.
Is this every going to be fixed? Its been eight months now since this was raised and I feels its somewhat of a major issue. It makes apps look very unprofessional.
We are experiencing the same issue for navigation bar icons when switching between screens using Navigator.
Just wondering if anything was in the works for this?
In the meantime, I have a somewhat hacky workaround component to switch between 2 images on highlight, which works with resizeMode=contain
@MichaelDanielTom We have switched to SVGs. Didn't notice any problems so far.
@roman01la That's not really a solution for all though.
@roman01la I wasn't aware that SVGs were supported, how are you using them exactly, just in an
I use a background image for several sequential screens and did the following as a quick fix for each.
componentWillMount() {
// "Preload" static image
(<Image source={require('./background.png')} />);
}
I know it's another hacky fix, but it helps for the mean time.
@roman01la I'm curious also, how are you using svg?
@MichaelDanielTom @blakeandrewwood We are using ReactNativeART package which is included into React Native. This article has examples of rendering SVG.
@blakeandrewwood how are you rendering the Image inside the component after doing that with componentWillMount()? Thanks.