更改水平进度条不确定的颜色 [英] Change horizontal progress bar indeterminate color

查看:132
本文介绍了更改水平进度条不确定的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改水平不确定的颜色?到目前为止,它采用标准主题颜色.

Is it possible to change horizontal indeterminate color? As of now it is take standard theme color.

我想将其更改为橙色吗?

I would like to change it to orange?

我知道我们已经更改了圆形颜色,但是我不确定是否要更改尝试使用的主题的水平颜色,可绘制的自定义进度条等,但是无法工作.

I know we have change the circle color I am not sure to change the horizontal color tried Theme, custom progress bar in drawable etc but couldn't get work.

这是XML:

<ProgressBar
   android:id="@+id/status_progress"
   style="?android:attr/progressBarStyleHorizontal"
   android:layout_width="match_parent"
   android:layout_height="15dp"
   android:layout_below="@id/status_text"
   android:indeterminate="true"
   android:indeterminateOnly="true" />

推荐答案

progressBar.getIndeterminateDrawable()
    .setColorFilter(progressBar.getContext().getResources().getColor(<colorId>),
        PorterDuff.Mode.SRC_IN);

这篇关于更改水平进度条不确定的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆