React Native of Android don't support GIF? If I want to add gif support, what should I do?
Asked
Active
Viewed 1,852 times
1
-
1refer http://stackoverflow.com/questions/6533942/adding-gif-image-in-an-imageview-in-android – sasikumar Feb 02 '16 at 07:26
-
It should work out of the box... I'm using gifs with no problems on RN 0.18. – Corentin S. Feb 04 '16 at 14:00
-
You can use Glide https://github.com/bumptech/glide. It is much more faster. – Tasneem Nov 21 '16 at 10:36
1 Answers
1
By default the Gif images are not supported in android react native app. You need to set the following code to display the gif images. The code: Open your android/app/build.gradle file add the following code in the place of
open android/app/build.gradle add the following code
dependencies: {
...
// For animated GIF support
compile 'com.facebook.fresco:animated-base-support:0.11.0'
// For WebP support, including animated WebP
compile 'com.facebook.fresco:animated-gif:0.11.0'
compile 'com.facebook.fresco:animated-webp:0.11.0'
compile 'com.facebook.fresco:webpsupport:0.11.0'
then you need to bundle the app again, You can display the gif images in two ways like this.
1-> <Image source={require('./../images/load.gif')} style={{width: 100, height: 100 }}/>
2-> <Image source={{uri: 'http://www.clicktorelease.com/code/gif/1.gif'}} style={{width: 100, height:100 }}/>
I hope it is helpful to others,

Venkatesh Somu
- 4,710
- 4
- 23
- 22