Reputation: 1635
Extra empty header space is coming at top of screen
I tried making header null for posts screen but empty space is still coming for the other two screens.
const Posts=createStackNavigator({
Posts:{screen:createMaterialTopTabNavigator(screens,{
tabBarOptions: {
scrollEnabled: true,
},
animationEnabled:false,
})},
VideoDetailScreen:{screen:VideoDetail},
NewsDetailScreen:{screen:NewsDetail},
});
const AppContainer = createAppContainer(Posts);
Upvotes: 2
Views: 2956
Reputation: 3123
It might come from StatusBar.
You can try setting headerStatusBarHeight: 0
<Stack.Screen
options={{
headerStatusBarHeight: 0,
}}
...
/>
Upvotes: 0
Reputation: 163
If you use StatusBar with translucent options, you need to use in your screenOptions on Stack.Navigator, the option headerStatusBarHeight: 0
https://stackoverflow.com/a/69213691/7641774
Upvotes: 2
Reputation: 62
You need to pass headerMode:'none'
export default StackNavigator({
LoginScreen: { screen: Login.component }
}, {
initialRouteName: 'LoginScreen',
headerMode: 'none'
})
Upvotes: 0
Reputation: 349
I fixed following this workaround by adding an option to navigationOptions
as follows:
navigationOptions: {
...
headerForceInset: { top: 'never', bottom: 'never' },
},
Upvotes: 3