DetailsScreen.js 1.6 KB

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