Reputation: 68
I am trying to hide a whole tab bar for the specific page on my app. I have tried to hide it on the routing and inside the container too. But, it did not work. I could hide header navbar in both scenarios but it is not working for tabBar. Below are my attempt codes:
<Scene
key="showBarcodeScanner"
hideNavBar
hideTabBar
{...DefaultProps.navbarProps}
iosStatusbar="light-content"
component={BarcodeScan}
/>
Below method did not work either
static navigationOptions = ({ navigation }) => ({
header: null,
tabBarVisible: false
});
I have checked the source and there is a logic to hide the tab (did not go deep though).
if (navigationParams.hideTabBar != null) {
if (navigationParams.hideTabBar) {
res.tabBarVisible = false;
}
} else if (hideTabBar) {
res.tabBarVisible = false;
}
Am I missing something? Is there any other method to hide the tabbar for a specific page?
Upvotes: 0
Views: 2431
Reputation: 11
For those using reactnavite expo, this might be usefull
<Tabs>
<Tabs.Screen
name="index"
options={{
href: null,
}}
/>
</Tabs>
Upvotes: 0
Reputation: 68
I found the solution after some research.
The Scene I wanted to hide was inside the Stack which was under the Tabs in my routes. And without shuffling navigators below code does not work based on official source: React Navigation
tabBarVisible: false
I just created a new Stack above my Tabs and the problem is solved.
Upvotes: 0