我在标题中看不到标题:const withHeader = ( screen: Function, routeName: string, Header): StackNavigator => createStackNavigator({ [routeName]: { screen, navigationOptions: ({ navigation, routeName }) => ({ header: props => <Header {...props} />, title: routeName, headerMode: "screen", layoutPreset: "right" }) } });this.props 不包含标题道具。如何将标题传递给我的标题?
1 回答
手掌心
TA贡献1942条经验 获得超3个赞
您可以static navigationOptions在您的班级/屏幕中使用:
class TargetScreen extends React.Component {
static navigationOptions = {
title: 'Your Title',
};
/* render function, etc */
}
添加回答
举报
0/150
提交
取消