Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
209 views
in Technique[技术] by (71.8m points)

java - Circle Progress Bar color doesn't change (Android)

Basically i have a circular progress bar and i have set a style to it, but the color does not change at all, its just green the whole time.

Code:

               <ProgressBar
                    android:id="@+id/markAssistedProgressLayout"
                    android:visibility="gone"
                    style="@style/progressBarWhite"
                    android:layout_width="50dp"
                    android:layout_height="50dp" />


Style file:

    <style name="progressBarWhite" parent="@style/Theme.AppCompat">
        <item name="colorAccent">@color/cherry_red_10_percent_opacity</item>
    </style>

The pic:

enter image description here

Hope someone could help me.

question from:https://stackoverflow.com/questions/65557660/circle-progress-bar-color-doesnt-change-android

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Rather than using a style, i directly set a indeterminateTint.

                <ProgressBar
                    android:id="@+id/markAssistedProgressLayout"
                    android:visibility="gone"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:indeterminateTint="@color/white"/>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...