使用Fresco库在全屏显示GIF图像

4
我正在使用Fresco库来全屏显示图像。如何使用该库全屏显示动画GIF图像?是否有其他更优的解决方案?
1个回答

1

您需要在Gradle文件中添加动态GIF解码的依赖项:

implementation 'com.facebook.fresco:animated-gif:1.12.1'

然后,只需将图像加载到 SimpleDraweeView 中:

mSimpleDraweeView.setController(Fresco.newDraweeControllerBuilder()
        .setAutoPlayAnimations(true)
        .setOldController(simpleDraweeView.getController())
        .setUri(yourGifUrl)
        .build());

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接