Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide navbar programmatically #2492

Closed
wants to merge 2 commits into from
Closed

Conversation

onrige
Copy link
Collaborator

@onrige onrige commented Oct 10, 2017

According to this issue #2441 and this commit (2909046) I am adding this functionallity again. I was trying to catch the issue when NavBar was hiding inside Drawer but I didn't succeed. May be I don't know something but according to the React Navigation docs it's not possible to put NavBar inside Drawer. @aksonov could you provide more detailed example for me to catch this error? As I said in commit comment - there are a lot of people that need this functionality so we need to resolve this problem.

@onrige onrige changed the title Hide navbar pragmatically Hide navbar programmatically Oct 10, 2017
@thiemo--bleeken
Copy link

please merge

@aksonov
Copy link
Owner

aksonov commented Oct 13, 2017

Can you just check Example project with your PR? You will see no drawer button there after 'go to tabbar page', sorry, I can't merge and break this.

just replace

    "react-native-router-flux": "file:../",

to

    "react-native-router-flux": "github:aksonov/react-native-router-flux#1364b111cff4fa218c9521e13a780e1228a6a708",

within Example/package.json to reproduce

@onrige
Copy link
Collaborator Author

onrige commented Oct 14, 2017

Fine. So please have a look at the last update. There was a problem with hiding Drawer because of hideNavBar property (child inheritance). It was fixed by just removing this property from Drawer child (Scene component in case of Example project) and now all works good. I am also added an example to TabView component with toggle NavBar functionality.

UPD: Hmm, nope, there is still some problems with hiding NavBar in some cases (for example with tabs).

@aksonov
Copy link
Owner

aksonov commented Oct 16, 2017

Yes, it still has problems - just tap "next screen for tab2_1" and you will not see "back" nav button.

@aksonov
Copy link
Owner

aksonov commented Nov 10, 2017

@onrige Please check latest master, I hope I fixed that issue and your code to Example/navigationStore. Feel free to reopen if you have any bugs.

@aksonov aksonov closed this Nov 10, 2017
@CodeRabbitYu
Copy link

CodeRabbitYu commented Jan 10, 2018

If I want to hide hideTabBar, the first success, the second failed.

_editPress = () => {
this.setState({
            hideTabBar: !this.state.hideTabBar
            }, () => {
                Actions.refresh({
                    hideTabBar: this.state.hideTabBar
                });
            }
        );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants