DetailsScreen.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Created by Arison on 2019/6/11.
  3. */
  4. import React from "react";
  5. import { View, Button,Text } from "react-native";
  6. export class DetailsScreen extends React.Component {
  7. static navigationOptions = {
  8. title: 'DetailsScreen',
  9. headerBackTitle:'返回',//设置返回此页面的返回按钮文案,有长度限制
  10. }
  11. render() {
  12. return (
  13. <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
  14. <Text style={{marginBottom: 10}}>Details Screen</Text>
  15. <View style={{margin: 3}}>
  16. <Button
  17. title="再次进入详情界面"
  18. onPress={() => this.props.navigation.push('Details')}
  19. ></Button>
  20. </View>
  21. <View style={{margin: 3}}>
  22. <Button
  23. title="跳转到主界面"
  24. onPress={() => this.props.navigation.navigate('Home')}
  25. />
  26. </View>
  27. <View style={{margin: 3}}>
  28. <Button
  29. title="返回"
  30. onPress={() => this.props.navigation.goBack()}
  31. />
  32. </View>
  33. </View>
  34. );
  35. }
  36. }