diff --git a/index.js b/index.js index 555497ebf..d49a1157b 100644 --- a/index.js +++ b/index.js @@ -210,11 +210,17 @@ class ActionContainer { //console.log("NAV LATEST SCENE:"+routes[routes.length-1].getName()+" "+routes.length); while (routes.length <= number || routes[routes.length-1].getType() === 'switch'){ // try parent navigator if we cannot pop current one - if (navigator.parentNavigator){ + var parentNavigator = navigator.parentNavigator; + if ( ! parentNavigator) { + parentNavigator = this.navs[navigator.props._parent]; + } + + if (parentNavigator) { //console.log("pop to parent navigator"); - navigator = navigator.parentNavigator; + navigator = parentNavigator; routes = navigator.getCurrentRoutes(); - } else { + } + else { throw new Error("Cannot pop navigator with less than "+number+" screens"); } } @@ -547,7 +553,7 @@ class Router extends React.Component { new ExRoute(route, this.schemas))} style={styles.transparent} - sceneStyle={{ paddingTop: 0 }} + sceneStyle={{ paddingTop: 0, backgroundColor: 'transparent' }} showNavigationBar={!this.props.hideNavBar} {...this.props}