react-navigation TabNavigator
来源:2-8 TabNavigator精讲-3
慕田峪1131113
2018-05-09
使用导航器,设定的样式在android模拟器上不起作用,而且图标也显示不出来
写回答
1回答
-
CrazyCodeBoy
2018-05-14
TabNavigator在Android和iOS上存在差异的,具体可参考视频课程中的讲解:
export const AppTabNavigator = TabNavigator({ Page1: { screen: Page1, navigationOptions: { tabBarLabel: 'Page1', tabBarIcon: ({tintColor, focused}) => ( <Ionicons name={focused ? 'ios-home' : 'ios-home-outline'} size={26} style={{color: tintColor}} /> ), } }, Page2: { screen: Page2, navigationOptions: { tabBarLabel: 'Page2', tabBarIcon: ({tintColor, focused}) => ( <Ionicons name={focused ? 'ios-people' : 'ios-people-outline'} size={26} style={{color: tintColor}} /> ), } }, Page3: { screen: Page3, navigationOptions: { tabBarLabel: 'Page3', tabBarIcon: ({tintColor, focused}) => ( <Ionicons name={focused ? 'ios-chatboxes' : 'ios-chatboxes-outline'} size={26} style={{color: tintColor}} /> ), } }, }, { tabBarComponent: TabBarComponent, tabBarOptions: { activeTintColor: Platform.OS === 'ios' ? '#e91e63' : '#fff', } });
00
相似问题