有一个图书馆可以做到这一点:
React Native View Shot
import RNViewShot from "react-native-view-shot"; RNViewShot.takeSnapshot(viewRef,{ format: "jpeg",quality: 0.8 }) .then( uri => console.log("Image saved to",uri),error => console.error("Oops,snapshot Failed",error) );