额外的空白标题空间出现在屏幕顶部
我尝试将帖子屏幕的标题设置为空,但其他两个屏幕仍会出现空白。
const Posts=createStackNavigator({
Posts:{screen:createMaterialTopTabNavigator(screens,{
tabBarOptions: {
scrollEnabled: true,
},
animationEnabled:false,
})},
VideoDetailScreen:{screen:VideoDetail},
NewsDetailScreen:{screen:NewsDetail},
});
const AppContainer = createAppContainer(Posts);
答案 0 :(得分:0)
我通过向navigationOptions
添加选项来固定this workaround,如下所示:
navigationOptions: {
...
headerForceInset: { top: 'never', bottom: 'never' },
},
答案 1 :(得分:0)
您需要传递headerMode:'none'
export default StackNavigator({
LoginScreen: { screen: Login.component }
}, {
initialRouteName: 'LoginScreen',
headerMode: 'none'
})