Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - Using ToolbarAndroid with Navigator's navigationBar

Tags:

react-native

I'm using React Native 0.14.0 to develop an Android application. Currently I'm using the ToolbarAndroid component to add a toolbar on top of my scene, but it is not kept between scenes. I found that the Navigator has a navigationBar property, which can be set to a Navigator.NavigationBar component, which should include an object dealing with the title and left and right buttons of the navigation bar. See the official example to understand what I mean. As there is little documentation on this part, I have to rely on the example to set the navigationBar properly.

This Navigator.NavigationBar is not as powerful as the ToolbarAndroid, as itdoesn't automatically have space for the logo, for example.

Is there any way to use ToolbarAndroid with the navigationBar property of the Navigator?

like image 876
mrcasals Avatar asked Nov 19 '15 16:11

mrcasals


1 Answers

Not really. The closest you could probably get is to wrap the ToolbarAndroid in a component and map the navigator left, right methods to the onIconClicked functions. But that defeats the purpose as you are probably most interested in the ToolbarAndroid's UI.

You need to pass a component that will behave something like the Navigator.NavigationBar. If you can drop in a component that will play nice and provide some of the expected props then it'll work.

like image 161
Harry Moreno Avatar answered Oct 25 '22 05:10

Harry Moreno