0

我正在尝试添加一个顶部标签栏,当我在我的发现标签时可见。我该怎么做呢?感谢您的帮助!这就是我设置底部标签栏的方式:

    export const Tabs = TabNavigator({
      Discover: {
screen: DiscoverScreen,
navigationOptions: {
  tabBar: {
    label: "Discover",
    icon: ({tintColor}) => <Icon name="list" size={20} color={tintColor}/>
  }
},
},

 Tickets: {
screen: TicketScreen,
navigationOptions: {
  tabBar: {
    label: "Tickets",
    icon: ({tintColor}) => <Icon name="photo" size={20} color={tintColor}/>
  }
},
},
MyProfile: {
screen: MyProfile,
navigationOptions: {
  tabBar: {
    label: "Profile",
    icon: ({tintColor}) => <Icon name="account-circle" size={20} color={tintColor}/>
  }
},
},
}, {
    tabBarComponent: NavigationComponent,
tabBarPosition: 'bottom',
tabBarOptions: {
bottomNavigationOptions: {
  labelColor: 'red',
  rippleColor: 'white',
  tabs: {
    Discover: {
      barBackgroundColor: '#37474F'
    },
    MyProfile: {
      barBackgroundColor: '#00796B'
    },
  }
}

} });

4

1 回答 1

0

解决了!

   const DiscoverNav = TabNavigator({
Feed: {
screen: FeedScreen
},
Clubs: {
screen: CoolScreen
},
  //Add in more tabs here
},
{
tabBarPosition: 'top'
   });

const MainTabNav = TabNavigator({
Discover: {
screen: DiscoverNav
},
     Tickets: {
screen: TicketScreen
},
   Profile: {
screen: MyProfile
  }
 },
于 2017-04-27T20:34:34.963 回答