View Code? Open in Web Editor
NEW
This project forked from gre/react-native-view-shot
react-native-view-shot
Home Page: https://github.com/gre/react-native-view-shot-example
License: MIT License
JavaScript 33.97%
Ruby 2.10%
C++ 23.12%
TypeScript 39.64%
CMake 1.18%
react-native-view-shot's People
react-native-view-shot's Issues
通过componentSnapshot进行截图,如果组件没有设置背景色对HarmonyOS来说则是默认透明,截图效果为黑色。所以为了正常,被截图的容器组件需要设置背景色
uri对应的path不存在
let file = fs.openSync(uri, fs.OpenMode.READ_WRITE);
let path = file.path;
if (path == null) return;
fs.access(path).then((res: boolean) => {
if (!res) { // 根据uri获取的path,在此判断是否存在时,返回的false
return;
}
if (file.getParent() == this.ctx.uiAbilityContext.cacheDir) {
fs.unlinkSync(path);
}
})
fs.closeSync(file);