【发布时间】:2014-09-12 08:36:14
【问题描述】:
是否可以将旋转进度条用作 Android XML 中 Image View 的 src?或者如果不通过 XML 则以编程方式进行?
提前谢谢你。
【问题讨论】:
是否可以将旋转进度条用作 Android XML 中 Image View 的 src?或者如果不通过 XML 则以编程方式进行?
提前谢谢你。
【问题讨论】:
使用AnimationDrawable 在图像视图中显示进度
ImageView img = (ImageView)findViewById(R.id.spinning_wheel_image);
img.setResource(R.drawable.spin_animation);
// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getDrawable();
// Start the animation (looped playback by default).
frameAnimation.start();
有关帧动画 android 的详细信息,请参阅this。
【讨论】: