2.0.6 • Published 5 years ago

react-native-svg-img v2.0.6

Weekly downloads
79
License
-
Repository
github
Last release
5 years ago

react-native-svg-img

Getting started

$ npm install react-native-svg-img --save

Add <uses-permission android:name="android.permission.INTERNET" /> to Manifest file on android

Mostly automatic installation

$ react-native link react-native-svg-img

IOS

  1. In Xcode, Go to Build Phases add libxml2.tbd in Link binary with libraries
  2. In Xcode, add $(SRCROOT)/usr/include/libxml2 In Header Search Paths (Under search paths column in Build Settings)

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-svg-img and add RNSvgImage.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNSvgImage.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.rctsvg.RNSvgImagePackage; to the imports at the top of the file
  • Add new RNSvgImagePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-svg-img'
    project(':react-native-svg-img').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-svg-img/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-svg-img')

Usage

import SvgImageView from 'react-native-svg-img';

// TODO: What to do with the module?
SvgImageView;

<SvgImageView
	width={200}
	height={200}
	source={require('./imagePath.svg')}
/>
2.0.6

5 years ago

1.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago