routers.js
import {createBottomTabNavigator} from 'react-navigation-tabs';
import home from '../views/home';
import my from '../views/my';
const RouteConfigs = {
home: {
screen: home, // This attribute works
tabBarLabel: 'cc', // Why he didn't work
showLabel: false, // Why he didn't work
},
my: {
screen: my,
},
};
const TabOptions = {
swipeEnabled: true,
animationEnabled: true,
};
const StackNavigator = createBottomTabNavigator(RouteConfigs, TabOptions);
export default StackNavigator;
import {createAppContainer} from 'react-navigation';
import routers from './routers';
export default createAppContainer(routers);
预期:['cc','my']] >>
但是实际结果:['home','my']
screen: home, // This attribute works tabBarLabel: 'cc', // Why he didn't work showLabel: false, // Why he didn't work
doc:https://reactnavigation.org/docs/en/bottom-tab-navigator.html
mycode routers.js从'react-navigation-tabs'导入{createBottomTabNavigator};从“ ../views/home”导入家;从'../views/my'导入my; const RouteConfigs = {主页:{屏幕:首页,...
您必须将它们作为navigationOptions
通过: