
>他们使用现已弃用的库.
>他们使用不允许暂停(和恢复)动画的库,这是我想做的事情.
目前最简单的方法是什么?
解决方法 有一个很好的库可以在您的应用中显示gif图像. android-gif-drawable它具有非常好的XML和Java用法.它还为您提供了一个非常易于使用的API.
以下是您可能感兴趣的方法列表:
总结
Gifdrawableimplements anAnimatableandMediaPlayerControlso you can use its methods and more:stop()– stops the animation,can be called from any threadstart()– starts the animation,can be called from any threadisRunning()– returns whether animation is currently running or notreset()– rewinds the animation,does not restart stopped onesetSpeed(float factor)– sets new animation speed factor,eg. passing 2.0f will double the animation speedseekTo(int position)– seeks animation (within current loop) to given position (in milliseconds)getDuration()– returns duration of one loop of the animationgetCurrentposition()– returns elapsed time from the beginning of a current loop of animation
以上是内存溢出为你收集整理的Android:显示和暂停GIF图像全部内容,希望文章能够帮你解决Android:显示和暂停GIF图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)