使用react-native-ui-kitten
组件BottomNavigation
并BottomNavigationTab
在我在 iPhone 上运行的应用程序(expo v2.21.2,react-native
v0.57.1 )中,当前选定的顶部有一条水平线,BottomNavigationTab
其中包含标题和图标。
从我的应用程序:
测试 B选项卡被选中,并且在图标上方有不需要的水平线。
从文档:
BottomNavigation
文档显示,当同时定义标题和图标时,所选选项卡上没有水平线。但这对我来说不是这样。
问题:如何去除水平线?
我的代码:
import { View } from 'react-native';
import { createBottomTabNavigator, createStackNavigator, createSwitchNavigator, createAppContainer } from 'react-navigation';
import { BottomNavigation, BottomNavigationTab, BottomNavigationProps, Avatar } from 'react-native-ui-kitten';
class BottomNavigationShowcase extends React.Component {
...
render () {
return (
<BottomNavigation
selectedIndex={this.state.selectedIndex}
onSelect={this.onTabSelect}
>
<BottomNavigationTab title='Test A' icon={this.renderIconA} />
<BottomNavigationTab title='Test B' icon={this.renderIconB} />
<BottomNavigationTab title='Test C' icon={this.renderIconC} />
<BottomNavigationTab title='Test D' icon={this.renderIconD} />
</BottomNavigation>
);
}
}
const TabNavigator = createBottomTabNavigator(
{
TestA: TestAScreen,
TestB: TestBScreen,
TestC: TestCScreen,
TestD: TestDScreen
}, {
initialRouteName: 'TestA',
tabBarComponent: BottomNavigationShowcase
}
)
const RootNavigator = createSwitchNavigator({
Main: TabNavigator,
}, {
initialRoute: "Main"
})