0

By default, I can only have a single line of text in the title of the NavBar with react-native-router-flux.

I want to have 2 lines of text in the title of the NavBar. Thus, how can I actually have a custom component as the title of the NavBar in react-native-router-flux?

Carven
  • 14,988
  • 29
  • 118
  • 161

1 Answers1

0

As described on the documentation, you can pass a custom NavBar to your Scene or Router.

 <Scene key="about" component={AboutScreen} navBar={()=>{return <CustomNavBar/>} />

Unfortunately, you cannot have a custom NavBar Title, so you have to create a whole NavBar if you really need this functionality.

I hope this helps. :)

Gui Herzog
  • 5,327
  • 2
  • 18
  • 22
  • Problem with creating an entirely custom NavBar is that I will lose all that standard functionalities such as back arrow, slide-fade transition animation when being dragged or navigated, etc, in my custom NavBar. :( – Carven Mar 19 '17 at 15:42
  • Yeah, true.. in this case I would recommend you to modify the library and try to do a PR, I'd even do it by myself if I wasn't too busy. The other solution is to create a custom component and place it right below the title, which is more of a hack rather than a solution. Either way, good luck! – Gui Herzog Mar 19 '17 at 22:04