I want a loading bar in a circle shape. I want to fill it with an integer i tried this
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@xml/progress" >
</ProgressBar>
progress.xml:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" >
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false" >
<size
android:height="48dip"
android:width="48dip" />
<gradient
android:centerY="0.50"
android:endColor="#000000"
android:startColor="#ffffff"
android:gradientRadius="20"
android:type="radial"
android:useLevel="false" />
</shape>
and in my activity
protected void onPostExecute(Void result) {
bar.setProgress(50);
bar.setMax(100);
bar.setVisibility(View.VISIBLE);
}
The Circle stays black. If i set the gradient type to sweep, the circle fills with startcolor black and endcolor white.. and it constantly repeats.
But I want the circle to be filled once.. so it starts black and fills white; only 1 time..
Is this possible?
I want to reach this result:
http://ultimateprogrammingtutorials.blogspot.be/2013/02/how-to-draw-circular-progress-bar-in.html
这是CircularProgressBar的一个很好的例子,根据你的要求希望这会对你有所帮助
An example of how to do this:
https://github.com/Todd-Davies/ProgressWheel
There are many similar questions on stackoverflow:
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.