Android 带有图像的自定义进度条
我知道以前有人问过这个问题,但我花了很多时间试图解释答案,但没有成功 我正在尝试获得一个带有图像的动画圆形进度条。 我参考这篇文章是为了获得基本的理解,但如何使用图像创建定制的进度条Android 带有图像的自定义进度条,android,android-progressbar,Android,Android Progressbar,我知道以前有人问过这个问题,但我花了很多时间试图解释答案,但没有成功 我正在尝试获得一个带有图像的动画圆形进度条。 我参考这篇文章是为了获得基本的理解,但如何使用图像创建定制的进度条 提前谢谢 我创建了一个通过对话框扩展的自定义类。也许这对你有帮助 public class CProgressDialog extends Dialog { private ImageView iv; public CProgressDialog(Context context) { super(con
提前谢谢 我创建了一个通过对话框扩展的自定义类。也许这对你有帮助
public class CProgressDialog extends Dialog {
private ImageView iv;
public CProgressDialog(Context context) {
super(context, R.style.TransparentProgressDialog);
WindowManager.LayoutParams wlmp = getWindow().getAttributes();
wlmp.gravity = Gravity.CENTER_HORIZONTAL;
getWindow().setAttributes(wlmp);
setTitle(null);
setCancelable(false);
setOnCancelListener(null);
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
iv = new ImageView(context);
iv.setImageResource(R.drawable.spiner_green);
layout.addView(iv, params);
addContentView(layout, params);
}
@Override
public void show() {
super.show();
RotateAnimation anim = new RotateAnimation(0.0f, 360.0f,
Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF,
.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(2000);
iv.setAnimation(anim);
iv.startAnimation(anim);
}
看到了吗?你想得到什么类型的进度条?看到了吗?我想这样开发。请描述一下如何在进度条中使用这个类。。请检查这个我想做的像这张图片。好吧,我建议你不是你要找的。。。使用第三方图书馆或从那里获取想法。。。和