react-native-navigation的迁移库

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from 'react';
  2. import {StyleSheet, ScrollView, Text} from 'react-native';
  3. import Row from '../components/Row';
  4. class Transitions extends React.Component {
  5. showCollapsingHeader = () => {
  6. this.props.navigator.showModal({
  7. title: 'Collapsing Header',
  8. screen: 'example.Transitions.CollapsingHeader',
  9. });
  10. };
  11. showSharedElementTransitions = () => {
  12. this.props.navigator.showModal({
  13. title: 'Shared Element Transition Examples',
  14. screen: 'example.Transitions.SharedElementTransitions',
  15. });
  16. };
  17. render() {
  18. return (
  19. <ScrollView style={styles.container}>
  20. <Row title={'Collapsing Header'} onPress={this.showCollapsingHeader}/>
  21. <Row title={'Shared Element Transition'} onPress={this.showSharedElementTransitions}/>
  22. </ScrollView>
  23. );
  24. }
  25. }
  26. const styles = StyleSheet.create({
  27. container: {
  28. flex: 1,
  29. },
  30. });
  31. export default Transitions;