react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Translucent StatusBar causes flicker on render heavy screens

Open vasafix opened this issue 3 years ago • 3 comments

Translucent StatusBar causes useSafeAreaInsets to return incorect values causing flicker

reprepo with bug example: https://github.com/vasafix/translucent-status-bar-bug

video example: p2P6

react-native: 0.67.1 react-native-safe-area-context: 3.3.2

vasafix avatar Jan 28 '22 14:01 vasafix

@vasafix did you manage to fix it? If yes, could you share how you did it?

HenrikZabel avatar Jul 31 '23 16:07 HenrikZabel

@HenrikZabel We hardcoded the top inset value, as most Android status bars are about 24px tall, this was not the best solution but was sufficient enough for our use-case.

I Just tested this with react-native-safe-area-context version 4.0.1 and it seems, that I am reliably getting top inset value every time, so I guess its time to do this the proper way :)

One major change we did, since I reported this bug, was to use @react-navigation/stack instead of @react-navigation/native-stack, you could give this a try if you are experiencing this bug even on the latest version of react-native-safe-area-context

vasafix avatar Jul 31 '23 17:07 vasafix

worked for me if I try to set the translucent in StatusBar using StatusBar.setTranslucent(true);

sujan-york-ie avatar Apr 24 '24 12:04 sujan-york-ie