Closed phuongphamx96 closed 1 year ago
@phuongphamx96 I know that androidx.core:core-splashscreen
try to do clever thing about system bars colors (and often mess up). I'm currently working to get rid of this package in react-native-bootsplash
to solve this kind of issues.
Until then, I recommend applying your initial style like this: https://github.com/swan-io/swan-partner-mobile/blob/main/src/screens/AuthenticationScreen.tsx#L56
In this example, the logo is animated, but it can be simplified to:
React.useEffect(() => {
const setSystemBarStyles = () => {
NavigationBar.pushStackEntry({ barStyle: "dark-content" });
StatusBar.pushStackEntry({ barStyle: "light-content" });
};
BootSplash.hide({ fade: true }).then(() => {
// A weird issue occurs on Android 12+ on app restart
Platform.OS !== "android" || Platform.Version < 12
? setSystemBarStyles()
: setTimeout(setSystemBarStyles, 500);
});
}, []);
@zoontek Great, thanks for your solution.
Bug summary
[Android 13+] barStyle prop of react-native-bars is not applied properly Hi @zoontek, I got this problem in my project and I tried with the example in your lib. I think the status bar content style follows what I set in
styles.xml
after the splash screen was hidden. If it'strue
, when I kill the app and open it again, the status bar content style still dark-content regardless the value I set in barStyle prop is light-content. `The issue happens on Android 13+ only. I tested on lower versions and it's working as my expectation. Thanks. issue.webm
Library version
4.7.2
Environment info
Steps to reproduce
Reproducible sample code