GIF Image display using WebView

后端 未结 8 803
北荒
北荒 2020-12-08 23:11

Can someone please provide a code to display GIF images in a webview ( I\'m already able to display the same using frame animation of png images) Now I want a way to display

8条回答
  •  抹茶落季
    2020-12-08 23:31

    This is the best solution for GIF in Android :

    Insert the following dependency to build.gradle file of your project.

    dependencies {
        compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    }
    

    then

    The simplest way is to use GifImageView 
    
    
    

    If drawables declared by android:src and/or android:background are GIF files then they will be automatically recognized as GifDrawables and animated. If given drawable is not a GIF then mentioned Views work like plain ImageView and ImageButton.

    https://github.com/koral--/android-gif-drawable

提交回复
热议问题