我只是想知道是否必须在所有屏幕上放置navigationOptions
。像这样:
const AppStackNavigator = createStackNavigator({
welcome: {
screen: WelcomeScreen,
navigationOptions: {
header: null
},
},
email: {
screen: EmailLoginScreen,
navigationOptions: {
header: null
},
},
password: {
screen: FindPassWordScreen,
navigationOptions: {
header: null
},
},
register: {
screen: RegisterScreen,
navigationOptions: {
header: null
},
},
agree: {
screen: AgreementScreen,
navigationOptions: {
header: null
}
}
})
我可以将navigationOptions
包装到所有屏幕吗?但这会给我带来错误。
const AppStackNavigator = createStackNavigator({
welcome: WelcomeScreen,
email:EmailLoginScreen,
password:FindPassWordScreen,
register: RegisterScreen,
agree: AgreementScreen,
navigationOptions: {
header: null
},
})
答案 0 :(得分:0)
是的,可以将设置应用于所有路线,您只是做错了
在这里
const AppStackNavigator = createStackNavigator({
welcome: WelcomeScreen,
email:EmailLoginScreen,
password:FindPassWordScreen,
register: RegisterScreen,
agree: AgreementScreen,
},{
navigationOptions: {
header: null
}
})