[native-stack] Header is out of the safe area on Android with translucent status bar
See original GitHub issueWhen setting StatusBar translucent
to true, header will get render out of safe area on android.
StatusBar translucent=true
StatusBar translucent=false
Snack code: https://snack.expo.io/Ld5Ma4ZNM
import * as React from 'react';
import { Text, View, StatusBar } from 'react-native';
import { enableScreens } from 'react-native-screens';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from 'react-native-screens/native-stack';
enableScreens();
const Stack = createNativeStackNavigator();
function HomeScreen() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<StatusBar
barStyle="light-content"
backgroundColor="rgba(0, 0, 0, 0.3)"
translucent
animated
/>
<Text>Home Screen</Text>
</View>
);
}
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Application" component={HomeScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
Environment
software | version |
---|---|
iOS or Android | Android |
@react-navigation/native | 5.1.6 |
react-native-screens | 2.7 |
react-native | 0.62.2 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Supporting safe areas | React Navigation
Status bar overlay; Home activity indicator on iOS; Navigation bar on Android. The area not overlapped by such items is referred to as...
Read more >How to use SafeAreaView for Android notch devices?
This should be the accepted answer as it takes uses the StatusBar.currentHeight instead of a arbitrary height. Note that the status bar height ......
Read more >createStackNavigator - React Navigation - Netlify
Safe area insets for the screen. This is used to avoid elements like notch and status bar. By default, the device's safe area...
Read more >react native splash screen status bar color - You.com
Safe Search: Moderate. Off. Moderate. Strict. Open links in a new tab ... Change color of statusBar in splashScreen react-native android.
Read more >StatusBar - React Native
Android. . If the status bar is translucent. When translucent is set to true , the app will draw under the status bar....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@WoLewicki is it possible to look into this too? This is issue with android devices and header again 😦
I am investigating it.