喜欢这个。.
此选项卡导航器位于堆栈导航器内部。我在下面添加了我的代码。我只想在此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;