【发布时间】:2021-03-14 22:34:02
【问题描述】:
如何使进度条结束。下图中是我目前拥有的。如您所见,开始和结束都是圆形的。我还想在进展结束的地方四舍五入。我该怎么做?
我的 custom_progressbar.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Define the background properties like color etc -->
<item android:id="@android:id/background">
<shape>
<corners android:radius="8dp" />
<solid android:color="@color/progressBarStrokeColor" />
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="8dp" />
<gradient
android:angle="180"
android:centerColor="@color/purple_700"
android:centerY="1.0"
android:endColor="#000000"
android:startColor="@color/red" />
</shape>
</clip>
</item>
</layer-list>
【问题讨论】:
-
尝试将半径更改为 45dp
-
我尝试更改背景的半径,但进度并没有任何变化。现在背景的圆角半径为 45dp。
标签: android xml progress-bar