Search code examples
androidanimated-gif

How to Display Animated GIF in ImageView


How to display Animated Gif in Imageview I had Used Gif from Drawable folder its not Displying like Gif. Nee Help plz

Here is m my Imageview Code

    <ImageView
            android:layout_width="40dp"
            android:id="@+id/ivGif"
            android:src="@drawable/success_bg"
            android:layout_height="40dp"
            android:gravity="center|bottom"
            android:visibility="visible" />

Solution

  • i just used this code and its working first add library

    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'

    then set gif layout where you want to put gif like this

    <pl.droidsonroids.gif.GifTextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/your_gif"/>