Android:显示和暂停GIF图像

Android:显示和暂停GIF图像,第1张

概述我知道很多人已经问过如何在 Android中显示GIF图像,但大多数答案都存在大多数问题: >他们使用现已弃用的库. >他们使用不允许暂停(和恢复)动画的库,这是我想做的事情. 目前最简单的方法是什么? 有一个很好的库可以在您的应用中显示GIF图像. android-gif-drawable 它具有非常好的XML和Java用法.它还为您提供了一个非常易于使用的API. 以下是您可能感兴趣的方法列表 我知道很多人已经问过如何在 Android中显示gif图像,但大多数答案都存在大多数问题:

>他们使用现已弃用的库.
>他们使用不允许暂停(和恢复)动画的库,这是我想做的事情.

目前最简单的方法是什么?

解决方法 有一个很好的库可以在您的应用中显示gif图像. android-gif-drawable

它具有非常好的XML和Java用法.它还为您提供了一个非常易于使用的API.

以下是您可能感兴趣的方法列表:

Gifdrawable implements an Animatable and MediaPlayerControl so you can use its methods and more:

stop() – stops the animation,can be called from any thread start() – starts the animation,can be called from any thread isRunning() – returns whether animation is currently running or not reset() – rewinds the animation,does not restart stopped one setSpeed(float factor) – sets new animation speed factor,eg. passing 2.0f will double the animation speed seekTo(int position) – seeks animation (within current loop) to given position (in milliseconds) getDuration() – returns duration of one loop of the animation getCurrentposition() – returns elapsed time from the beginning of a current loop of animation
总结

以上是内存溢出为你收集整理的Android:显示和暂停GIF图像全部内容,希望文章能够帮你解决Android:显示和暂停GIF图像所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1123642.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存