相关疑难解决方法(0)

如何在进度条中将颜色设置为二次可绘制

我有这个代码

 pb = (ProgressBar) findViewById(R.id.progressBar1);
    final float[] roundedCorners = new float[] { 5, 5, 5, 5, 5, 5, 5, 5 };
    ShapeDrawable pgDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null, null));
    String MyColor = "#00FF00";
    pgDrawable.getPaint().setColor(Color.parseColor(MyColor));
    ClipDrawable progress = new ClipDrawable(pgDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL);
    pb.setProgressDrawable(progress);
    pb.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal));
Run Code Online (Sandbox Code Playgroud)

此代码中的问题是,对于可绘制的进度和可绘制的辅助进度,我具有相同的颜色.

如何设置社会进步的颜色?

android colors drawable progress-bar

1
推荐指数
1
解决办法
9239
查看次数

标签 统计

android ×1

colors ×1

drawable ×1

progress-bar ×1