@@ -94,10 +94,16 @@ var Router = React.createClass({
9494 } ;
9595
9696 var Content = route . component ;
97+
98+ // Remove the margin of the navigation bar if not using navigation bar
99+ var extraStyling = { } ;
100+ if ( this . props . hideNavigationBar ) {
101+ extraStyling . marginTop = 0 ;
102+ }
97103
98104 return (
99105 < View
100- style = { [ styles . container , this . props . bgStyle ] }
106+ style = { [ styles . container , this . props . bgStyle , extraStyling ] }
101107 onStartShouldSetResponder = { didStartDrag }
102108 onResponderMove = { didMoveFinger }
103109 onResponderTerminationRequest = { preventDefault } >
@@ -124,21 +130,27 @@ var Router = React.createClass({
124130 StatusBarIOS . setStyle ( 1 ) ;
125131 }
126132
133+ var navigationBar ;
134+
135+ if ( ! this . props . hideNavigationBar ) {
136+ navigationBar =
137+ < NavBarContainer
138+ style = { this . props . headerStyle }
139+ navigator = { navigator }
140+ currentRoute = { this . state . routeObj }
141+ backButtonComponent = { this . props . backButtonComponent }
142+ rightCorner = { this . props . rightCorner }
143+ titleStyle = { this . props . titleStyle }
144+ toRoute = { this . onForward }
145+ toBack = { this . onBack }
146+ customAction = { this . customAction }
147+ />
148+ }
149+
127150 return (
128151 < Navigator
129152 initialRoute = { this . props . firstRoute }
130- navigationBar = {
131- < NavBarContainer
132- style = { this . props . headerStyle }
133- currentRoute = { this . state . route }
134- backButtonComponent = { this . props . backButtonComponent }
135- rightCorner = { this . props . rightCorner }
136- titleStyle = { this . props . titleStyle }
137- toRoute = { this . onForward }
138- toBack = { this . onBack }
139- customAction = { this . customAction }
140- />
141- }
153+ navigationBar = { navigationBar }
142154 renderScene = { this . renderScene }
143155 onDidFocus = { this . onDidFocus }
144156 />
0 commit comments