简体   繁体   中英

Change spinning wheel style from ProgressBar Android

I have a ProgressBar with the attribute

style="?android:attr/progressBarStyleLarge"

which shows the next spinning wheel:

来自 ProgressBar 的旋转轮

But to keep the same style in all my application, I wanted to use, in my ProgressBar , the spinning wheel shown on SwipeRefreshLayout by default:

来自 SwipeRefreshLayout 的旋转轮

How can I achieve this? Thanks!


[ADDED]

I'm looking for the spinning style, its movement and how is it shown. It works something like this: while turning around, the black "bar" gets longer and then shorter and then again longer and so on,.. changes its size always in the same direction that the bar moves (really difficult to explain how it works, that's why I refered to SwipeRefreshLayout 's spinning wheel)

If you just want to change the color / style, try this (Android Lollipop + ) :

progCircle.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.myXMLColor), PorterDuff.Mode.SRC_IN);

More information about PorterDuff here

我想这就是你要找的

style="@style/Base.Widget.AppCompat.ProgressBar"

Try using this persons progress bar

https://android-arsenal.com/details/1/1141

you will need to call .Spin() in your code to start it.

Add This to you gradle build file as followed

repositories {
    maven { url "https://jitpack.io" }
    compile 'com.pnikosis:materialish-progress:1.7'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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