加载gif图片闪退怎么处理



    • loading.js
      import loadingImage from '../image/loading.gif';
      export default class LoadingView extends Component {
      constructor(props) {
      super(props);
      }
      _close() {
      console.log("onRequestClose ---- ")
      }
      render() {
      const { showLoading} = this.props;
      return (
      <Modal onRequestClose={() => this._close()} visible={showLoading} animationType={"none"} transparent={true} >
      <View style={[styles.loadingView, { opacity: 0.3, backgroundColor: 'gray' }]}></View>
      <View style={styles.loadingImageView}>
      <View style={styles.loadingImage}>
      <Image style={styles.loadingImage} source={loadingImage} />
      </View>
      </View>
      </Modal>
      )
      }
      }
    • /android/app/build.gradle

    dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+" // From node_modules

    // For animated GIF support
    compile 'com.facebook.fresco:animated-gif:0.11.0'

    }

    写的一个loading遮罩,把image注释掉就好了,打开就闪退



  • @wangpengzong 说:

    compile 'com.facebook.fresco:animated-gif:0.11.0'

    已解决 compile 'com.facebook.fresco:animated-gif:0.11.0'改成compile 'com.facebook.fresco:animated-gif:0.13.0'


登录后回复