PopularPage: {
screen: PopularPage,
navigationOptions: {
tabBarLabel: '最热',
headerShown: false,
tabBarIcon: ({ color, focused }) => (
<MaterialIcons name={'whatshot'} size={26} style={{ color: color }} />
),
},
},
...
const tabs = { PopularPage, TrendingPage, FavoritePage, MyPage }; //根据需要定制显示的tab
Object.entries(tabs).map((item) => {
...
item[0] 对应的是XXXPage,如PopularPage的screen,以此类比item[1]对应的是navigationOptions