navigationOptions
来配置TabNavigator
的header
:const TabNav = TabNavigator({
First: { screen: FirstPage },
Second: { screen: SecondPage },
Third: { screen: ThirdPage },
Fourth: { screen: FourthPage },
Fifth: { screen: FifthPage }
}, {
navigationOptions: {
header: <SearchHeader />
}
})
然后在 FifthPage 中自定义 navigationOptions
:
class FifthPage extends Component {
static navigationOptions = {
header: <FifthPageHeader />
}
}
TabNavigator
文档中,它没有列出header
选项,我认为它将传递给StackNavigator
。