sebap
sebap

Reputation: 1691

React native router flux : how to overrride burger button style?

Is there way to customize padding / position... of the burger button. In the doc, i just can find the drawerImage parameter to override the burger image...

Upvotes: 1

Views: 727

Answers (3)

Damathryx
Damathryx

Reputation: 2828

in my case I use react-native-vector-icons getImageSource for the burger icon

componentWillMount() {
  Promise.all([Icon.getImageSource('bars', 16, 'black')])
  .then((values) => {
    this.setState({
       menuIcon: values[0],
     });
  });
}

then you do something like this:

const menuIcon = {
  uri: this.state.menuIcon.uri,
  height: 20,
  width: 20,
  resizeMode: 'stretch',
  color: 'white',
};

then in your tabs scene

<Scene
    key="main"
    type="replace"
    initial
    drawerImage={menuIcon}
    tabs
    style={{ backgroundColor: theme.navColor, justifyContent: 'center' }}
>

Upvotes: 0

sebap
sebap

Reputation: 1691

Actually there's a parameter for it : leftButtonStyle

Upvotes: 0

SnowMax
SnowMax

Reputation: 611

Saddly no option without forking. You can check the code here: https://github.com/aksonov/react-native-router-flux/blob/master/src/NavBar.js. Padding and position is fixed.

Upvotes: 1

Related Questions