React Native Navigator总是在屏幕旋转时返回第一个屏幕

时间:2016-02-23 17:37:01

标签: android react-native react-router navigator

新的反应原生

我已经用这种方式实现了导航器:

renderScene(route, navigator) {
    var routeId = route.id;
    console.log("myid: " + routeId + " :: " + route.emailSuccess);
    if (routeId === 'test') {
        console.log("minto test");
        return ( 
            <Test navigator={navigator} emailSuccess={route.emailSuccess} />
        );
    } else if (routeId === 'Invitation') {
        console.log("into Invitation");
        return ( 
            <Invitation navigator={navigator} customerId={route.customerId} />
        );
    } else {
        console.log("into demo");
        return (
            <OnBoardingDemo navigator={navigator} />
        );
    }
}

并导航到我所做的不同场景:

    _navigator.push({
        id: 'test',
    });

序列是Demo&gt;邀请&gt;测试

例如,每当我进入Test场景时,当我旋转设备时,它会返回Demo场景。如何让它留在Test场景?

0 个答案:

没有答案