使用TabNavigator
的时候,在iOS上显示正常,但是在Android中显示的有问题,如下图,背景成了蓝色了。
经过查看官网文档。明白了少写了一个属性。tabBarComponent:TabBarBottom,
字面理解就是tabbar
组件,注意这是一个组件,需要导入,但是iOS中少了也没关系,可能是为了适配Android。
import {
StackNavigator,
TabNavigator,
TabBarBottom,
} from 'react-navigation';
//设置tabbar
{
tabBarOptions: {
activeTintColor: '#3DCCCA',
backgroundColor: 'white',
showIcon: 'true',
style:{
fontSize:12
}
},
tabBarPosition:'bottom',
swipeEnabled:false,
tabBarComponent:TabBarBottom,
}