ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 415 forks source link

for android ,tabbar can't hide #52

Closed moxiaobei2 closed 6 years ago

moxiaobei2 commented 8 years ago

when i used route for change activity,I can go to another activity,but tabbar is still showed.How I can hide the bar,how Can I do in the child activity?

dovfrank commented 8 years ago

+1

zubricky commented 8 years ago

Android doesn't support the style overflow: hidden. You could just move the tab bar off the screen.

var Dimensions = require('Dimensions');

if (hidden) {
    var tabBarStyle = {position: 'absolute', top: Dimensions.get('window').height};
    var sceneStyle = {paddingBottom: 0};
} else {
    let tabBarHeight = 50;
    var tabBarStyle = {height: tabBarHeight};
    var sceneStyle = {paddingBottom: tabBarHeight};
}

<TabNavigator
    tabBarStyle={tabBarStyle}
    sceneStyle={sceneStyle}
/>
moxiaobei2 commented 8 years ago

@zubricky thank you.

toearth commented 8 years ago

@zubricky Thanks +1

ptomasroos commented 6 years ago

Will close since this issue is more than a year, feel free to a open a new if this is still a issue.