創建blink.xml
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/selected" android:oneshot="false">
<item android:drawable="@drawable/Picture_1" android:duration="10000" />
<item android:drawable="@drawable/Picture_2" android:duration="10000" />
<item android:drawable="@drawable/Picture_3" android:duration="10000" />
<item android:drawable="@drawable/Picture_4" android:duration="10000" />
<item android:drawable="@drawable/Picture_5" android:duration="10000" />
</animation-list>
將blink.xml放入可繪製文件夾中並在活動代碼中寫入 將此代碼寫入。
ImageView mImageView ;
mImageView = (ImageView)findViewById(R.id.imageView); //this is your imageView
mImageView .setImageDrawable(getResources().getDrawable(R.drawable.blink));
然後你會得到你想要的。
謝謝,這真的很好,即時通訊android新手和即時編程的平板電腦使用3.1的東西,當我在我的虛擬android設備上運行的應用程序,它帶來了一個更小的屏幕像肖像是有無論如何修復這個和有什麼簡單的方法可以讓圖像視圖充滿屏幕?謝謝你這麼多 – 2011-05-25 16:53:00
試着把這個放在ImageView xml屬性上:android:layout_width =「fill_parent」android:layout_height =「fill_parent」。然後用你需要的值設置android:scaleType屬性。看看這個鏈接:http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html – BFil 2011-05-25 17:01:22
工程很好@BFil。謝謝!!! – groff07 2013-10-24 12:50:35