const MyApp = TabNavigator({
Home: {
path:'/home',
screen: MyHomeScreen,
},
Shop: {
path:'/shop',
screen: ShopScreen,
},
Service: {
path:'/service',
screen: ServiceScreen,
},
Find:{
path:'/find',
screen:FindScreen,
},
My: {
path:'/my',
screen: MyScreen,
},
}, {
tabBarPosition: 'bottom',
animationEnabled: false,//点击菜单是否有过渡效果,比如目前在第一个,现在点击最后一个会过渡滚动
swipeEnabled:true,//手指左右滑动切换底部按钮
lazy: true,
lazyLoad:true,
tabBarOptions: {
upperCaseLabel: false,
showIcon: true,
showLabel:true,
style: {
backgroundColor: myColor.white,
borderTopWidth:isIos?0.5:0,
borderTopColor:myColor.grey4,
paddingBottom:isIos?3:0,
marginBottom:isIos?0:10,
},
indicatorStyle: {
height:0
},
iconStyle:{
marginBottom:isIos?0:-5,
},
labelStyle: {
},
activeTintColor: myColor.secondary2,
inactiveTintColor:myColor.grey0,
activeBackgroundColor: 'transparent',
inactiveBackgroundColor: 'transparent',
}
});
现在是 MyHomeScreen、ShopScreen 5个Screen都会执行,目的是只有点击tab的时候才会渲染对应页面,lazy,lazyLoad 都不起作用,请问如何解决,感激不尽