我想从底部选项卡导航器中删除图标空间/视图。我试图通过删除 tabBarIcon 来删除图标,但它没有用。这是我尝试过的代码和收到的结果。它看起来不太好,标签不在中心。它们看起来好像已经低于可见屏幕。使用的代码:
const TabNavigator = createMaterialBottomTabNavigator(
{
Home: {
screen: screen1,
navigationOptions: {
// tiitle: "hello"
// tabBarIcon: () => {
// <View></View>
// },
tabBarLabel: <Text style={{ fontSize: 15, textDecorationLine: 'underline', }}>Screen1</Text>,
}
},
People: {
screen: screen2,
navigationOptions: {
tabBarLabel: <Text style={{ fontSize: 15, textDecorationLine: 'underline' }}>Screen2</Text>,
activeColor: '#E8947F',
inactiveColor: '#C4C9CB',
}
},
Connects: {
screen: screen3,
navigationOptions: {
tabBarLabel: <Text style={{ fontSize: 15, textDecorationLine: 'underline' }}>Screen3</Text>,
activeColor: '#E8947F',
inactiveColor: '#C4C9CB',
// barStyle: { backgroundColor: '#2c6d6a' },
}
},
},
{
initialRouteName: 'Home',
activeColor: '#E8947F',
inactiveColor: '#C4C9CB',
barStyle: { backgroundColor: '#00000000' },
});
结果:
我是 React-Native 的新手。请帮我。