可以使用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