render() {
return (
<View>
<Text>2</Text>
<Button
title = "跳转到指定的页面(可以重复),类似Android(standard)"
onPress = {() => this.props.navigation.push('Profile')}
/>
<Button
title = "跳转到指定的页面(不可以重复),类似于Android(singleTask)"
onPress = {() => this.props.navigation.navigate('Home')}
/>
<Button
title = "返回上一个页面"
onPress = {() => this.props.navigation.goBack()}
/>
<Button
title = "返回第一个页面"
onPress = {() => this.props.navigation.popToTop()}
/>
</View>
)
}
React-Navigation
最新推荐文章于 2024-06-19 15:20:21 发布