我已成功地将我的进度条的颜色更改为颜色(蓝色,绿色等)中的颜色,但是当我给出特定颜色的十六进制代码时,它。我该如何解决这个问题?Progressbar没有显示任何颜色变化
ProgressBar pg = (ProgressBar)findViewById(R.id.progressBarDownload);
final float[] roundedCorners = new float[] { 5, 5, 5, 5, 5, 5, 5, 5 };
ShapeDrawable progressDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null,null));
progressDrawable.getPaint().setColor(0x01060012);//<-----problem here?
ClipDrawable progress = new ClipDrawable(progressDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL);
pg.setProgressDrawable(progress);
pg.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal));
pg.setProgress(40);
类,我试过了,但我的应用程序崩溃。它显示logcat中的未知颜色 – Abx
在MyColor字符串中选择diffent颜色 – Janmejoy
@Abhila sh是否正在工作 – Janmejoy