React-navigation: how to style a big middle button in tab navigation?

后端 未结 3 2018
青春惊慌失措
青春惊慌失措 2021-02-04 15:12

So I have this requirement. To make tab navigation with this exact appearance:

I had no problem styling the tab bar with the gradient and the buttons. I created my own

3条回答
  •  时光取名叫无心
    2021-02-04 15:42

    enter image description here


    You can try my solution

    const TabNavigator = createBottomTabNavigator(
    {
    Top: {
      screen: HomeScreen,
      navigationOptions: {
        tabBarIcon: ({tintColor}) => (
          
        ),
      },
    },
    
    New: {
      screen: HomeScreen,
      navigationOptions: {
        tabBarIcon: ({tintColor}) => (
          
        ),
      },
    },
    Ask: { // big plus icon in the middle
      screen: HomeScreen,
      navigationOptions: {
        tabBarIcon: ({tintColor}) => (
          
            
          
        ),
      },
    },
    Show: {
      screen: HomeScreen,
      navigationOptions: {
        tabBarIcon: ({tintColor}) => (
          
        ),
      },
    },
    Jobs: {
      screen: HomeScreen,
      navigationOptions: {
        tabBarIcon: ({tintColor}) => (
          
        ),
      },
    },
    },
    {
    tabBarOptions: {
      activeTintColor: '#FF6F00',
      inactiveTintColor: '#8997B0',
      showIcon: true,
      showLabel: false,
      style: {
        backgroundColor: '#f1f6f9',
      },
    },
    },
    );
    

提交回复
热议问题