react-native-navigation的迁移库

LightBoxScreen.js 790B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React, {Component} from 'react';
  2. import {
  3. Text,
  4. View,
  5. ScrollView,
  6. TouchableOpacity,
  7. StyleSheet
  8. } from 'react-native';
  9. export default class LightBoxScreen extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. render() {
  14. return (
  15. <View style={{width: 300, height: 200, padding: 20}}>
  16. <Text>
  17. This is a LightBox
  18. </Text>
  19. <TouchableOpacity onPress={ this.onDismissPress.bind(this) }>
  20. <Text style={styles.button}>Dismiss</Text>
  21. </TouchableOpacity>
  22. </View>
  23. );
  24. }
  25. onDismissPress() {
  26. this.props.navigator.dismissLightBox();
  27. }
  28. }
  29. const styles = StyleSheet.create({
  30. button: {
  31. textAlign: 'center',
  32. fontSize: 18,
  33. marginBottom: 10,
  34. marginTop:10,
  35. color: 'blue'
  36. }
  37. });