react-native-svg 使用

github:https://github.com/react-native-svg/react-native-svg
安装: 

yarn add react-native-svg@12.4.4 react-native-svg-uri

注意: 如果运行 yarn android 报错

 Task :react-native-svg:compileDebugJavaWithJavac FAILED

 

 尝试更换react-native-svg版本号

使用: 

import SvgUri from "react-native-svg-uri";
const svg = '<svg .............> </svg>'
<SvgUri svgXmlData={svg} width="60" height="60" />

 

posted @ 2022-08-30 18:33  龙卷风吹毁停车场  阅读(297)  评论(0)    收藏  举报