如何以编程方式在react-native中截取屏幕截图

前端之家收集整理的这篇文章主要介绍了如何以编程方式在react-native中截取屏幕截图前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何在ReactNative中截取屏幕截图.我需要一个截图并将其放在 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)
);
原文链接:https://www.f2er.com/react/300900.html

猜你在找的React相关文章