react native 只能用 navigator 控制界面跳转吗

2024-11-22 15:38:45
推荐回答(1个)
回答(1):

//...
ddebugOverlay={false}
initialRoute={{ title: 'Main', id:'http'}}
configureScence={{ configureScence }}
renderScene={renderSceneAndroid}
/>

var _navigator; //全局navigator对象
//...
renderSceneAndroid: function(route, navigator){
_navigator = navigator;

if(route.id === 'http'){
return (

);
}

if(route.id === 'shop'){
return (

);
}

//...
// 调用push 跳转
_navigator.push({title:'Http',id:'http'}) } style={ styles.button }>
NetWork