question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[NavigatorIOS] Implement hidesBottomBarWhenPushed to hide TabBar while doing push in native module

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mcampsallcommented, Jul 22, 2016

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

0reactions
mkonicekcommented, Oct 27, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found