2017-05-26 50 views
1

我最近下載了一個gif圖像以將其插入到我的新Android Studio項目中。下載後,我將.gif文件複製到可繪製文件夾中。我稱之爲「形象」。在activity_main佈局的部分「文字」我寫這:在Android Studio項目上運行gifImageView

<ImageView 
     android:id="@+id/imageView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     app:srcCompat="@drawable/image" 
     app:layout_constraintTop_toTopOf="parent" 
     android:layout_marginTop="8dp" 
     app:layout_constraintBottom_toBottomOf="parent" 
     android:layout_marginBottom="8dp" 
     app:layout_constraintVertical_bias="0.498" 
     android:layout_marginRight="8dp" 
     app:layout_constraintRight_toRightOf="parent" 
     android:layout_marginLeft="8dp" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintHorizontal_bias="0.595" /> 

在apparence有沒有問題......但是,當我開始我的應用程序的GIF不起作用。它像.jpg文件圖像一樣是靜態的。我可以在Android手機的應用程序中播放我的.gif圖像嗎?

回答

1

以及使用imageview不會做你想做的事情。有幾種方法可以查看gif。 example link或者您可能只是想使用library

相關問題