takesnapshotasync在Android上捕获黑色图像

时间:2018-09-10 15:52:32

标签: android react-native expo

我正在使用takeSnapShotAsync截图我的MapView,设置如下:

const newPic = await Expo.takeSnapshotAsync(this.refs.routeMap, {
      result: "base64",
      height: "1080",
      width: "1080",
      quality: 0,
      format: "jpeg"
    });

我的Mapview看起来像这样:

<MapView
          style={styles.map}
          ref="routeMap"
          region={this.state.region}
          showsUserLocation
          showsMyLocationButton
          followUserLocation={true}
          zoomEnabled={true}
          onRegionChangeComplete={this.setZoom}
>
<Polylines route={this.state.route} />
</MapView>

这在iOS上完美运行,但在android上运行时我只是得到黑色图像。知道为什么以及如何解决吗?

0 个答案:

没有答案