[NavigatorIOS] Implement hidesBottomBarWhenPushed to hide TabBar while doing push in native module
See original GitHub issueI followed the discussion on https://github.com/facebook/react-native/issues/720 and https://github.com/facebook/react-native/issues/1489, it seems the problem is not solved yet.
While it’s really easy to implement in Objective-C while setting viewController.hidesBottomBarWhenPushed = YES, I’m wondering if it’s possible to have it in native module.
// Objective-C
UIViewController *vc = [[UIViewController alloc] init];
vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
// JavaScript
this.props.navigator.push({
title: 'Detailed View',
component: DetailedView,
hidesBottomBarWhenPushed: true, // if possible
});
In the meanwhile, I was trying to modify RCTNavItem.m to pass additional attribute (hidesBottomBarWhenPushed) and RCTNavigator.m to inject code before the [_navigationController pushViewController:vc animated:(currentReactCount > 1)];
But it doesn’t work even though the attribute is correctly set before the pushViewController method, could anyone give me some insight about how to make it work?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:11 (3 by maintainers)
Top Results From Across the Web
[NavigatorIOS] Implement hidesBottomBarWhenPushed to ...
[NavigatorIOS] Implement hidesBottomBarWhenPushed to hide TabBar while doing push in native module. mkonicek.
Read more >How To Hide Tab Bar in Navigation Interface in React Native?
In Xcode's lefthand sidebar, choose the 'Project Manger' (folder icon) to see the file structure. The particular folder you are looking for is...
Read more >How to hide the tab bar when a view controller is shown
This will hide the tab bar along with any toolbars you had showing, but only when a view controller is pushed onto the...
Read more >[Solved]-How to create Custom Bottom Tab Bar in React Native?
iDev Custom Tab Bar Modal Window being Hidden by Tab Bar. How can I change this? How to prevent going back in React...
Read more >hidesBottomBarWhenPushed | Apple Developer Documentation
A Boolean value indicating whether the toolbar at the bottom of the screen is hidden when the view controller is pushed on to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got it to work! See this SO answer for the code. I also posted it here if you want to see it in context
Hi there! This issue is being closed because it has been inactive for a while.
But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/navigatorios-implement-hidesbottombarwhenpushed-to-hide-tabbar-while-doing-push-in-native-module
Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.