react native 怎么跳转界面
1个回答
展开全部
//...
<Navigator
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 (
<HttpView navigator={navigator} route={route} />
);
}
if(route.id === 'shop'){
return (
<ShopView navigator={navigator} route={route}/>
);
}
//...
// 调用push 跳转
<TouchableOpacity onPress={ () => _navigator.push({title:'Http',id:'http'}) } style={ styles.button }>
<Text>NetWork</Text>
</TouchableOpacity>
<Navigator
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 (
<HttpView navigator={navigator} route={route} />
);
}
if(route.id === 'shop'){
return (
<ShopView navigator={navigator} route={route}/>
);
}
//...
// 调用push 跳转
<TouchableOpacity onPress={ () => _navigator.push({title:'Http',id:'http'}) } style={ styles.button }>
<Text>NetWork</Text>
</TouchableOpacity>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询