2.0.6 • Published 5 years ago
react-native-svg-img v2.0.6
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
- In Xcode, Go to
Build Phases
addlibxml2.tbd
inLink binary with libraries
- In Xcode, add
$(SRCROOT)/usr/include/libxml2
In Header Search Paths (Under search paths column in Build Settings)
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-svg-img
and addRNSvgImage.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNSvgImage.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- 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 thegetPackages()
method
- 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')
- 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
1.1.2-semantically-released
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.2-semantically-released
6 years ago
1.0.1-semantically-released
6 years ago
1.0.0
6 years ago