1
votes

I'm trying to render a navbar custom right button.

React-native-router-flux version: ^3.43.0

The code looks something like this:

<Scene
  initial
  key="RegistrationType"
  navigationBarStyle={Style.navBarStyleBlue}
  renderRightButton={() => (
    <View style={{
      backgroundColor: 'yellow',
      height: 50,
      alignItems: 'center',
      justifyContent: 'center'
    }}>
      <TouchableOpacity onPress={Actions.Login}>
        <Text>Login</Text>
      </TouchableOpacity>
    </View>
  )}
  component={RegistrationType}
  title=""
  hideNavBar={false}
/>

Navbar's style:

navBarStyleBlue: {
  backgroundColor: 'blue',
  borderBottomWidth: 0,
  height: 50
},

So basically I'm trying to get the right button to be aligned vertically with the navbar and get something like this:

enter image description here

But instead I get this:

enter image description here

Any ideas?

1

1 Answers

0
votes

Figured it. Have to use rightButtonStyle property.

rightButtonStyle={{
  top: 0,
  height: 50,
  padding: 0,
  justifyContent: 'center',
  alignItems: 'center'
}}