const Tab = createBottomTabNavigator(
{
Home: {
screen: createStackNavigator({Home: HomePageScene}),
navigationOptions: ({navigation}) => ({
tabBarLabel: "首页",
tabBarOnPress: () => { // 使用tabBarOnPress点击事件
if (!navigation.isFocused()) {
// 路由方法, 动态跳转到对应界面
navigation.navigate(navigation.state.routeName, {
title: navigation.state.routeName
})
//通知,刷新首页数据
DeviceEventEmitter.emit("homeTabClickNotice", {update:true});
}
},
tabBarIcon: ({focused, tintColor}) => (
<TabBarItem
tintColor={tintColor}
focused={focused}
normalImage={require("./img/tabbar_home.png")}
selectedImage={require("./img/tabbar_home_selected.png")}
/>
)
})
},
Mine: {
screen: createStackNavigator({Mine: MineScene}),
navigationOptions: ({navigation}) => ({
tabBarLabel: "个人",
tabBarIcon: ({focused, tintColor}) => (
<TabBarItem
tintColor={tintColor}
focused={focused}
normalImage={require("./img/tabbar_shop.png")}
selectedImage={require("./img/tabbar_shop_select.png")}
/>
)
})
}
},
{
tabBarComponent: TabBarBottom,
tabBarPosition: "bottom",
lazy: true,
animationEnabled: false,
swipeEnabled: false,
tabBarOptions: {
activeTintColor: color.color_108D87,
inactiveTintColor: color.color_666666,
},
}
);