我想要一个圆形的加载栏。我想用一个整数来填补它我想这Android进度条填充
<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>
,并在我的活动
protected void onPostExecute(Void result) {
bar.setProgress(50);
bar.setMax(100);
bar.setVisibility(View.VISIBLE);
}
的圈子保持黑色。如果我设置渐变类型扫描,圆圈填充startcolor黑色和endcolor白色..它不断重复。
但是我想让圆圈填充一次..所以它开始黑色填充白色;只有1次..
这可能吗?
我想达到这样的结果:
http://ultimateprogrammingtutorials.blogspot.be/2013/02/how-to-draw-circular-progress-bar-in.html
我们应该想的问题或将U向移动你想要在这里? –
请再次阅读我的文章,我编辑..谢谢! – RobinHo