1.0.1 • Published 7 years ago

react-native-svg-paths v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

react-native-svg-paths

基于react-native-svg

 用于显示svg图片(svg图片内容将path内容转为json数组)。

Getting started

npm.io.

Mostly automatic install with react-native

  1. npm install react-native-svg-paths
  2. react-native link react-native-svg

Usage

import SvgPath from 'react-native-svg-paths' ;
...
<SvgPath
	viewBox="0 0 1024 1024"//设置为原svg图的viewBox值,默认0 0 1024 1024
        width={20}
        height={20}
        pathD={require("../../svg/gift.json")} //可以是svg的d值字符串;[{"d":"xxx},{"d":"yyy"}],	[{"d":"xxx,"fill":"0xff0000"},				{"d":"yyy","fill":"0xff0000"}]
	fillColor="#999" //如果svg的path没有fill字段,可通过此设置图片颜色。
        />

more about svg go to