有一个图书馆可以做到这一点:
React Native View Shot
原文链接:https://www.f2er.com/react/300900.htmlimport 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) );