how to display headers in react navigation with TabNavigation

前端 未结 2 948
野趣味
野趣味 2021-02-06 23:30

I noticed that views in StackNavigation show the header title but if I set those same screens in a TabNavigation it doesn\'t show a header. It only shows a header if I wrap a S

2条回答
  •  迷失自我
    2021-02-07 00:00

    According to React-Navigation TabNavigator Docs there is no header navigationOption. Therefore, when you write the following code you are actually setting a nonexisting value thus what you are doing does not affect anything.

    navigationOptions: {
      header: { visible: true },
    }
    

    Sadly, you need a StackNavigator in this situation.

提交回复
热议问题