简体   繁体   中英

react-navigation and status bar color blinking on view change

In react-navigation v5 alpha, when I navigate between views, I have my statusBar color blinking.

Its final state is often not the one desired, while in development and working on the view, it get's to the right color after hot reload, but when navigating, it's often the dark theme that win.

Even if I use in the next view:

<StatusBar barStyle="light-content" translucent={true} backgroundColor="transparent" />

This happen in expo SDK36 application.

How can I fix this?

Add animated={true} to StatusBar, this will smoothly change bar color.

<StatusBar animated={true} barStyle="light-content" translucent={true} backgroundColor="transparent" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM