我决定使用
根据文档:http://frescolib.org/docs/animations.html 我可以使用以下代码来自动播放动画:
然而,当我使用这段代码时,它只显示静态图片。我需要采取其他步骤才能播放GIF/WEBP吗?或者是我误解了文档中“animation”的用法?
编辑:使用ControllerListener后,我发现onFinalImageSet()返回的Animatable对象为空。我不确定原因。
我还尝试运行了此示例项目,但.gif文件也没有动画效果:https://github.com/kaedea/fresco-sample-usage 顺便说一下,我的测试设备是Nexus 5X(版本6.0.1)。
Fresco
,因为它提供了解决我的问题: GIF
和 WEBP
播放的方案。根据文档:http://frescolib.org/docs/animations.html 我可以使用以下代码来自动播放动画:
Uri uri;
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setUri(uri)
.setAutoPlayAnimations(true)
. // other setters
.build();
mSimpleDraweeView.setController(controller);
然而,当我使用这段代码时,它只显示静态图片。我需要采取其他步骤才能播放GIF/WEBP吗?或者是我误解了文档中“animation”的用法?
编辑:使用ControllerListener后,我发现onFinalImageSet()返回的Animatable对象为空。我不确定原因。
我还尝试运行了此示例项目,但.gif文件也没有动画效果:https://github.com/kaedea/fresco-sample-usage 顺便说一下,我的测试设备是Nexus 5X(版本6.0.1)。