【发布时间】:2015-05-07 13:29:19
【问题描述】:
【问题讨论】:
-
最好只制作自定义视图来制作那个东西。例如,您可以使用 imageview 来显示该线和带有该圆圈的 4 个视图,这并不困难且快速完成
-
@BrainAmplifier18 你可以使用图片来实现它。
标签: android android-progressbar
【问题讨论】:
标签: android android-progressbar
您可以通过使用代表流程不同阶段的不同图像来实现这一点
保持可见性消失的图像视图,并在您想要显示时使其可见
在您的可绘制文件夹中保留一个类似于以下 progressanimation.xml 的 xml
<?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/progressone" android:duration ="400" />
<item android:drawable="@drawable/progresstwo" android:duration="400" />
<item android:drawable="@drawable/progressthree" android:duration="400" />
<item android:drawable="@drawable/progressfour" android:duration="400" />
</animation-list>
and use this as background of your ImageView like follows
iv.setVisibility(View.VISIBLE);
iv.setBackgroundResource(R.drawable.progressanimation);
final AnimationDrawable mailAnimation = (AnimationDrawable) iv
.getBackground();
iv.post(new Runnable() {
public void run() {
if (mailAnimation != null)
mailAnimation.start();
System.out.println("anim wrkingggg");
}
});
这里iv是你的imageview。这段代码会自动改变背景。你可以让runnable在你自己的时间限制下运行。
【讨论】: