简体   繁体   English

无法在Android的SimpleArcLoader中设置自定义颜色

[英]Not able to set custom color in SimpleArcLoader in android

Here is a SimpleArcLoader library I am using as progress bar. 这是我正在用作进度栏的SimpleArcLoader库。

https://github.com/generic-leo/SimpleArcLoader https://github.com/generic-leo/SimpleArcLoader

Here is my code: 这是我的代码:

int[] colors = {R.color.colorPrimaryDark, R.color.colorPrimary};

ArcConfiguration configuration = new ArcConfiguration(getActivity());
configuration.setColors(colors);

SimpleArcDialog  mDialog = new SimpleArcDialog(getActivity());
mDialog.setConfiguration(configuration);
mDialog.show();

This always gives me a gray color. 这总是给我灰色。 I also tried with other colors but same result. 我也尝试了其他颜色,但结果相同。

Here is a screenshot 这是截图

Is my input is wrong? 我的输入错误吗? Or is there any solution? 还是有什么解决方案?

您必须这样声明数组颜色:private int mColors [] = {Color.parseColor(“#F90101”),Color.parseColor(“#0266C8”)};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM