How to display GIF in react-native android app?

前端 未结 8 2085
醉梦人生
醉梦人生 2020-12-01 13:50

I want to display a simple gif via URL in my Image tag in my android react-native app but when I start it no image is shown. The code as provided in the docs does work only

相关标签:
8条回答
  • 2020-12-01 14:46

    We upgraded to "react-native": "^0.57.1", which stopped our animated gifs from playing; they just rendered the first frame of the animation as static images.

    To correct for this, we included the following libraries:

    compile 'com.facebook.fresco:animated-gif:1.10.0'
    compile "com.facebook.fresco:animated-base-support:1.3.0"
    
    // (Only if supporting WebP.)
    compile 'com.facebook.fresco:animated-webp:1.10.0'
    compile 'com.facebook.fresco:webpsupport:1.10.0'
    
    0 讨论(0)
  • 2020-12-01 14:53

    You can add these dependencies. I am using this in version (v0.44.0):

    compile 'com.facebook.fresco:animated-base-support:0.14.1'
    compile 'com.facebook.fresco:animated-gif:0.14.1' 
    

    In version v0.50 you only need to add

    compile 'com.facebook.fresco:animated-gif:1.3.0'

    0 讨论(0)
提交回复
热议问题