如何在Tabnav上方添加标题

时间:2019-01-19 17:28:48

标签: reactjs react-native react-native-android react-native-ios

enter image description here

喜欢这个。.

此选项卡导航器位于堆栈导航器内部。我在下面添加了我的代码。我只想在此TabNavigator上方添加如上图所示的标题。

const tabnavigator = createMaterialTopTabNavigator({
  Home:{
      screen:HomeStack,
      navigationOptions:{
        //tabBarLabel:'Home',
        tabBarIcon: ({tintColor,focused}) =>(

             <Image style={{width:18,height:20}} source={image = focused? require('../images/Icons/HomeIcons/homered3x.png') : require('../images/Icons/HomeIcons/home3x.png')}/>

        ),
      }
  },
  Packages:{
      screen:PackagesStack,
      navigationOptions:{
        //tabBarLabel:'Packages',
        tabBarIcon:({tintColor,focused})=>(

            <Image style={{width:15,height:20}} source={image = focused? require('../images/Icons/HomeIcons/packagesred3x.png') : require('../images/Icons/HomeIcons/packages3x.png')}/>

        )


      }

  }
},{tabBarOptions:{showLabel:false,showIcon:true,tabStyle:{backgroundColor:'white'}}});

const tabnav = createAppContainer(tabnavigator);


export default tabnav;

enter image description here

0 个答案:

没有答案