I'm using react-native-router-flux and have a navigation bar set up. Currently, the navigation bar is styled to have shorter height than the default height, so the elements inside the navigation bar container sits low, close to the bottom of the navigation bar container.
I tried navigationBarStyle={{backgroundColor: 'pink', height: 55, flex: 1, justifyContent: 'center'}}
but still no luck.
How can I vertically center the elements inside the navigation bar?
And currently, the right navigation bar button, Settings
is set to navigate to Settings
component. But on the Settings
page, would like to remove the Settings
right navigation bar button. How can I do so?
Here is how it looks like (navigation bar with the pink background is the container, and left drawer button, scene title (Home), and Settings button on right sit close the bottom of the navigation bar):
And here is the code:
const RouterWithRedux = connect()(Router)
const store = configureStore()
export default class App extends Component {
constructor() {
super()
}
render() {
return (
<Provider store={store}>
<RouterWithRedux>
<Scene key='root'>
<Scene component={Login} hideNavBar initial={true} key='login' sceneStyle={{backgroundColor: 'black'}} title='Login' type='reset'/>
<Scene key='drawer' component={NavDrawer} open={false}>
<Scene key="main" navigationBarStyle={{backgroundColor: 'pink', height: 55, flex: 1, justifyContent: 'center'}} onRight={() => Actions.settings()} rightTitle='Settings'>
<Scene
component={Home}
initial={true}
key='home'
sceneStyle={{backgroundColor: 'black'}}
title='Home'
type='reset'
/>
<Scene
component={Settings}
direction='vertical'
key='settings'
sceneStyle={{backgroundColor: 'black'}}
title='Settings'
/>
</Scene>
</Scene>
</Scene>
</RouterWithRedux>
</Provider>
)
}
}
Thank you in advance