Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 664 Bytes

File metadata and controls

26 lines (23 loc) · 664 Bytes

react-navigation-custom-header-example

library

"react-navigation": "^4.4.0",
"react-navigation-stack": "^2.8.2",

整个 stack 级别的自定义header, 放在 defaultNavigationOptions

defaultNavigationOptions:{
  header:<View><Text>default custom header</Text></View>
}

页面级别的自定义header, 放在 navigationOptions, 会覆盖stack的header

navigationOptions:{
  header:<View><Text>screen custom header</Text></View>
}

页面不需要header

navigationOptions:{ headerMode:'none' // 页面不需要 header }

注:例子只包含 navigator 的设置,RN项目代码,screen页面需要自己定义