How to make animated GIFs work from Android WebVie

2019-04-04 13:24发布

Animated GIF images rendered by Android's WebView do not seem to animate. Has anyone figured out how to make them work? I'm testing on an N1 with 2.1-u1. None of the web settings available seem applicable.

5条回答
Evening l夕情丶
2楼-- · 2019-04-04 14:05

Use WebP format for Android.

https://developers.google.com/speed/webp/

There are several online utilities available, to convert animated GIFs to WebP format (http://www.zamzar.com/convert/gif-to-webp/ is one example).

Note that WebP is not supported on most of the other browsers so you may need to apply some logic to select GIF or WebP based on platform.

查看更多
做自己的国王
3楼-- · 2019-04-04 14:13

Animated GIFs are supported in Froyo (Android 2.2).

查看更多
爷、活的狠高调
4楼-- · 2019-04-04 14:23

Not supported YET. Read more about this here: http://code.google.com/p/android/issues/detail?id=3422

For large memory phones like Droid and Nexus One, the two-line change has been made in Froyo (unreleased) to enable animated GIFs. For small memory phones, the change is not trivial and did not make it into this future release.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-04-04 14:24

As a workaround, if you are using a custom WebView, you can do these 2 things together:

Please note that this is not a solution for displaying GIFs, you must modify the content of the web, and convert/split GIF animations into different files (one for each frame) in any format (JPG, PNG, etc).

查看更多
【Aperson】
6楼-- · 2019-04-04 14:28

AFAIK, animated GIFs are not supported on Android except as movie clips played by MediaPlayer.

查看更多
登录 后发表回答