Skip to content

Navigator and Custom navigationBar #924

@iq-dot

Description

@iq-dot

Hi guys,

I am trying to use the Navigator to create a custom navigation bar by supplying my own view however I am not sure I am doing it right, here is my code:

      <Navigator
          style={styles.wrapper}
          navigationBar={MyNav}
          initialRoute={{
          component: MyView,
          title: 'MyTitle'
          }}
        renderScene={(route, navigator) =>
          React.createElement(route.component, {navigator})
        }
          />

...

var MyNav = React.createClass({
  render: function(){
    return (
        <View><Text>NavBar</Text></View>
    );
  }
});

What I end up getting is a small section at the bottom, am I meant to style it and put it at the top? Any styling tips here appreciated.

Also how do I get access to the 'route' object passed in to the navigator? If I log this.props, it has 'MyTitle' on the output along with other stuff but I am not quite sure what the object key is to access it.

Any help on this appreciated as I couldn't get much on the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions