Closed aryaminus closed 6 years ago
Sorry, I didn't quite understand the issue you're having. Could you please explain what should happen, but what's really happening? Thanks.
I have added the 3rd image. When i press "Video" tab in 1st screen, I want to transfer to 3rd screen but am going to 2nd screen with no styling in navbar but on preessing "Video" tab again, the "Therapist" is shown with styling
I see you're trying to render the BottomNavigation in each Scene, like in you Video.js you're rendering it with <Menu activeTab="2" />
. That should cause your problem, since the BottomNavigation becomes unmounted and remounted in every Scene and thus on every tab press.
You need to render <Menu />
outside of your Scenes. That way the BottomNavigation stays mounted all the time instead of being unmounted and remounted on every tab click.
I tried rendering withing App.js as it is the landing page after login but I am reaching a blank screen.
Please take a look at the Example from react-native-router-flux. There is an example with a CustomNavBar using a navBar
prop which you can find more details in their API docs.
I haven't used react-native-router-flux, but this looks like the stuff you need.
Fixed the issue but with bottom-navbar will showing in all scenes Reverted to:
"react-native-router-flux": "^4.0.0-beta.21"
Changed App.js:
import React, { Component, PropTypes } from "react";
import {
StyleSheet,
View,
StatusBar
} from "react-native";
import { Router, Scene } from "react-native-router-flux";
class App extends React.Component {
render() {
return (
<View style={styles.application}>
<Router>
<Scene key="root" style={{ paddingTop: 64 }}>
<Scene key="home" component={Home} title="Profile" type="reset" />
<Scene
key="chatmain"
component={ChatMain}
title="ChatMain"
type="reset"
/>
<Scene key="chat" component={Chat} title="Chat" />
<Scene key="friendlist" component={FriendList} title="FriendList" />
<Scene key="chatF" component={ChatF} title="ChatF" />
<Scene key="video" component={Video} title="Video" type="reset" />
<Scene
key="medical"
component={Medical}
title="Medical"
type="reset"
/>
</Scene>
</Router>
<Menu />
</View>
);
}
}
var styles = StyleSheet.create({
application: {
flex: 1
}
});
export default App;
Hi @timomeh, is there anyway to hide the navbar in some components while BottomNavigation is been rendered once like is done above? Thanks
In pictures: on Profile click, text and style shown but none on other tabs on clicking the tab twice,the text and style is shown Have removed the imports and style sheet. Using react-native-router-flux
App.js:
Menu.js:
Video.js: