AppNavigator 的header給隱藏掉,先給每一個(gè)控制器加上導(dǎo)航欄在隱藏TabNavigator 的導(dǎo)航欄
const Tab = createBottomTabNavigator({
Home: {
screen: HomePage,
},
Classfy: {
screen: ClassfyPage,
},
Chart: {
screen: ChartPage,
},
Setting: {
screen: SettingPage,
}
}, {
animationEnabled: true,
swipeEnabled: false,
swipeEnabled: true,//是否可以滑動(dòng)切換
animationEnabled: true,//切換是否有動(dòng)畫
initialRouteName: 'Home', //進(jìn)入App的首頁(yè)面
backBehavior: 'none', // 按 back 鍵是否跳轉(zhuǎn)到第一個(gè) Tab, none 為不跳轉(zhuǎn)
tabBarOptions: { //對(duì)于導(dǎo)航的設(shè)置
indicatorStyle: {height: 0}, //android特有下劃線的顏色1
inactiveTintColor: '#a9a9a9', // 文字和圖片默認(rèn)顏色
activeTintColor: color.activeBarText,
labelStyle: { //文字的樣式
fontSize: 10,
textAlign: 'center',
},
style: { //對(duì)于導(dǎo)航的stytles
backgroundColor: 'white', // TabBar 背景色
borderTopColor: '#ebebeb',
borderTopWidth: 1,
height: Dimensions.get('window').height * 0.08,
height: 50
}
},
});
Tab.navigationOptions = ({navigation}) => {
// 關(guān)鍵這一行設(shè)置 header:null
return{
header: null,
}
};
export default Tab;