我该如何在React Native中截屏。我需要一个屏幕截图并将其放在Image
组件中。我该怎么办?
最佳答案
有一个库可以做到这一点: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)
);
关于react-native - 如何以编程方式在react-native中截图,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39217726/