Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Is there no way to have transparent status bar on iOS in React Native > 0.60

$
0
0

Before I switched to RN 0.62 from RN 0.47 it's been pretty simple to support transparent status bar on both iOS and Android by just replacing Stack Navigation header with the StatusBar. Just specifying bar style was enough, it was transparent by default. I tried the same approach after the RN update, and now it does not seem to work.

<Stack.Screen        name="WelcomeScreen"        component={WelcomeScreen}         options={{          header: props =>  <StatusBar barStyle="dark-content" translucent={true} backgroundColor="transparent"/>, //<Header barStyle='dark-content' />,          gestureEnabled: false        }}

The piece above demonstrates what I attempted to do. The replacement itself does not yield any errors, changing 'barStyle' does affect the content color, but the background is static white, and can't figure out the way to change it. From StatusBar component documentation I found out that 'translucent' and 'backgroundColor' properties are only supported on Android. So, is it true that there is absolutely no way to accomplish this without going deep into native code ? I'd be glad to know for sure whether there is a workaround or not, since in worst case I'll just make customer swallow the fact that this kind of microadjustments of UI are too costly, but I have to be sure.


Viewing all articles
Browse latest Browse all 16750

Trending Articles