modol.js 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Created by wuyunqiang on 2018/1/16.
  3. */
  4. import React, { Component } from 'react';
  5. import {
  6. AppRegistry,
  7. Platform,
  8. StyleSheet,
  9. Text,
  10. View,
  11. ScrollView,
  12. Image,
  13. UIManager,
  14. TouchableOpacity,
  15. NativeModules,
  16. ImageBackground,
  17. DeviceEventEmitter,
  18. requireNativeComponent,
  19. } from 'react-native';
  20. const ReactNative = require('ReactNative');
  21. import PropTypes from 'prop-types';
  22. var ModalView = requireNativeComponent('ModalAndroid', App);//内部使用popwindow实现全屏
  23. export default class App extends Component {
  24. constructor(props){
  25. super(props);
  26. }
  27. render() {
  28. return (
  29. <ModalView
  30. ref = {(PopModal)=>{this.PopModal = PopModal}}
  31. {...this.props}>
  32. <View style={{flex: 1}}>
  33. {this.props.children}
  34. </View>
  35. </ModalView>
  36. )
  37. }
  38. }
  39. ModalView.propTypes = {
  40. ...View.propTypes,
  41. visible:PropTypes.bool,
  42. };