Gif 图像在反应原生的 android 中不起作用 [英] Gif image is not working in android in react native

查看:48
本文介绍了Gif 图像在反应原生的 android 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

动画在 android 中的 gif 图像中不起作用

推荐答案

请按照 FB docs 它将指定您需要的所需内容.

please follow the details in the FB docs it will specify the required things that you need.

您需要在 android/app/build.gradle 中添加一些可选模块,具体取决于您的应用程序的需求.

You will need to add some optional modules in android/app/build.gradle, depending on the needs of your app.

dependencies {
  // If your app supports Android versions before Ice Cream Sandwich (API level 14)
  compile 'com.facebook.fresco:animated-base-support:1.3.0'

  // For animated GIF support
  compile 'com.facebook.fresco:animated-gif:1.3.0'

  // For WebP support, including animated WebP
  compile 'com.facebook.fresco:animated-webp:1.3.0'
  compile 'com.facebook.fresco:webpsupport:1.3.0'

  // For WebP support, without animations
  compile 'com.facebook.fresco:webpsupport:1.3.0'
}

此外,如果您将 GIF 与 ProGuard 一起使用,则需要在 proguard-rules.pro 中添加此规则:

Also, if you use GIF with ProGuard, you will need to add this rule in proguard-rules.pro :

-keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl {
  public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier);
}

这篇关于Gif 图像在反应原生的 android 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆