要从一个或另一个屏幕浏览,我需要这个渲染器:
if (this.state.loggedIn) {
return <Centrale navigation={this.props.navigation} />
} else {
return <Accedi navigation={this.props.navigation} />
}
在两个屏幕上我都无法获得标题
static navigationOptions = ({ navigation }) => {
//console.log("ELENCO " + JSON.stringify(navigation))
return {
title: 'ELENCO SVEGLIE',
headerRight: <View />
};
};
但是如果我使用标准导航(this.props.navigate(“”)),则标题会起作用。建议?
setParams
是您要寻找的。 setParams
操作允许屏幕更改params
中的route
,这对于更新header buttons and title
非常有用。有关更多链接,请参见此处。here