react-native-yyimage
YYImage for React Native
This is react native port of YYImage library.
Hints you wanna know:
- use Pods for YYImage dependency
- lib returns the image size on
onLoadEnd
- port was written to match FLAnimatedImage implementation (it doesn't contain
onFrameChange
method )
Install
You have to install YYImage first via Pods
npm install react-native-yyimage --save
Link
In XCode, in the project navigator:
- Right click Libraries
- Add Files to [your project's name]
- Go to
node_modules/react-native-yyimage/RNYYImage
- Add the
.xcodeproj
file
In XCode, in the project navigator, select your project.
- Add the
libRNYYImage.a
from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries
Usage
; ... { if !enativeEventsize return; const width height = enativeEventsize; this; }... const style = width: thisstatewidth height: thisstateheight; return <YYImage source=uri:thispropsurl style=style resizeMode='contain' onLoadEnd= this/>;...
Changelog
Version 0.1.4
- Add method to get size of image (jpg, png, gif, webp - for webp need to install WebP framework from native YYImage)