Closed lidong1665 closed 8 years ago
I'm not sure I have understand your question, but I try to answer,
That depend how you implement your TabNavigator
:
1- If you put your TabNavigator
in a Navigator
, you can do it, by using this Navigator to push your next views,
2 - If you put each one of your child view in a Navigator
, you can try to set the height
to 0
, but I thing the first solution if the best for your question.
@magrinj Thanks for answering! Both of those approaches sound good and I agree that solution 1 is better if it meets the needs of the app.
Thank you very much. I'm very Sorry, my question is that click child view in a button push a new page,
Somewhere in your app you probably have some code that looks like this:
<TabNavigator>
<TabNavigator.Item
selected={this.state.selectedTab === 'group'}
...>
<GroupScreen />
</TabNavigator.Item>
<TabNavigator.Item
selected={this.state.selectedTab === 'profile'}
...>
<ProfileScreen />
</TabNavigator.Item>
</TabNavigator>
You need to re-render the parent component using this.setState({ selectedTab: 'group' })
.
The best way is to pass a callback into your component, and call this callback when the user taps the button:
<ProfileScreen onRegisterAccount={() => { this.setState({ selectedTab: 'group' }); }} />
when I push a new page,how to hide TabNavigator,