CardView内的createMaterialTopTabNavigator?

时间:2019-11-04 11:47:31

标签: reactjs react-native react-navigation tabnavigator react-native-tabnavigator

如何将createMaterialTopTabNavigator放置在CardView中?

我要实现下面的屏幕快照中所示的设计

enter image description here

我不知道应该在哪里写createMaterialTopTabNavigator,应该在同一页面中写它还是应该在RootScreen中写它(存在多个导航器,例如:StackNavigator和BottomTabNavigator)

我应该如何创建它?

1 个答案:

答案 0 :(得分:0)

我在要添加标签组件的同一页面中创建了一个createMaterialTopTabNavigator


const HistoryTabs = (
  {
    UPoints: {
      screen: UPointsScreen,     
    },
    MyPurchases: {
      screen: MyPurchasesScreen,     
    },

  },
  {initialRouteName:'UPoints' }

);
const AppContainer = createAppContainer(HistoryTabs);

在渲染中,我叫

 <View style={{flex:1}}>
      <AppContainer/>
 </View>