可以使用XML在我的android佈局中顯示動畫圖像嗎?使用XML在android中顯示動畫PNG圖像
3
A
回答
11
佈局
<ImageView
android:layout_width="82dip"
android:layout_height="50dip"
android:layout_centerInParent="true"
android:background="@drawable/spinner"
android:id="@+id/splashSpinner"/>
可繪製
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/anim__000" android:duration="100" />
<item android:drawable="@drawable/anim__001" android:duration="100" />
<item android:drawable="@drawable/anim__002" android:duration="100" />
<item android:drawable="@drawable/anim__003" android:duration="100" />
<item android:drawable="@drawable/anim__004" android:duration="100" />
<item android:drawable="@drawable/anim__005" android:duration="100" />
<item android:drawable="@drawable/anim__006" android:duration="100" />
<item android:drawable="@drawable/anim__007" android:duration="100" />
<item android:drawable="@drawable/anim__008" android:duration="100" />
<item android:drawable="@drawable/anim__009" android:duration="100" />
<item android:drawable="@drawable/anim__010" android:duration="100" />
<item android:drawable="@drawable/anim__011" android:duration="100" />
</animation-list>
JAVA
this.spinner = this.view.findViewById(R.id.splashSpinner);
this.spinner.post(new Runnable()
{
@Override
public void run()
{
AnimationDrawable spinnerAnim = (AnimationDrawable) spinner.getBackground();
if (!spinnerAnim.isRunning())
{
spinnerAnim.start();
}
}
});
2
相關問題
- 1. 在Android上顯示動畫圖像
- 2. 如何使用JavaScript顯示PNG圖像的動畫圖像? [like gmail]
- 3. 使用Swing顯示動畫PNG(apng)?
- 4. 如何使用openlayers3動畫圖像png
- 5. 在VB.NET中顯示動畫PNG
- 6. 未能在Android應用程序中顯示動畫GIF圖像
- 7. 顯示動畫圖像
- 8. %android png動畫
- 9. 圈PNG圖像使之互動在Android
- 10. 在J2me中顯示PNG圖像
- 11. Qt PNG圖像不顯示
- 12. PNG圖像不顯示
- 13. QWebView不顯示png圖像
- 14. 如何在Android應用上顯示啓動畫面圖像?
- 15. 在android中顯示一個動畫進度條GIF圖像
- 16. 在Android中顯示PNG文件(正在調整圖像大小)
- 17. 只有一個圖像視圖顯示android中的動畫
- 18. 啓動畫面中未顯示圖像
- 19. Android:使用XML在動畫中使用XML進行翻轉android
- 20. Android:無法在ImageView中顯示PNG圖像
- 21. Qt在Linux上不顯示PNG圖像
- 22. PNG圖像顯示在IOS半透明
- 23. PNG圖像不顯示寫字板,但顯示了在Word2010中
- 24. 畫中畫顯示XML顯示空
- 25. 如何使用.png圖片而不是.gif圖片在iphone中使用動畫顯示圖片?
- 26. 在android中動畫位圖圖像
- 27. android中的圖像動畫
- 28. PNG圖像上的動畫問題
- 29. 三維動畫與PNG圖像
- 30. Android圖像動畫
我知道,但我需要播放GIF文件。 – sahil 2012-01-31 13:16:10
你不是在談論你的問題中的gif ......在android項目中添加gif是不可能的。 – ChristopheCVB 2012-01-31 13:25:06
雅我知道,我得到了答案,當我搜查,但謝謝.. – sahil 2012-01-31 13:26:36