0.0.1 • Published 3 years ago

react-native-kpframework-svgkit v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-native-kpframework-svgkit

react-native-svg-uri基础上进行修改

Install library from npm

npm install react-native-kpframework-svgkit --save
npm install react-native-svg --save
// or
yarn add react-native-kpframework-svgkit
yarn add react-native-svg

目录

SvgImage

svg组件,使用方式类似于图片

import { SvgImage } from 'react-native-kpframework-svgkit';

<SvgImage width={200} height={200} source={require('./img/homer.svg')} />
<SvgImage
  width={200}
  height={200}
  source={{uri:'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'}}
/>

Props

PropTypeDefaultNote
styleViewStyle样式
widthnumber宽度
heightnumber高度
sourceImageSourceSame kind of source prop that <Image /> component has
svgXmlDataStringYou can pass the SVG as String directly
fillColorOverrides all fill attributes of the svg file
fillAllBooleanAdds the fill color to the entire svg object

开源库的原生文档

文档