Tôi cố gắng để đạt được điều này thiết kế thanh tiến trình: Thanh tiến trình với các góc tròn?
Mã hiện tại mà tôi có sản xuất này:
Đây là mã:
<item android:id="@android:id/background">
<shape>
<corners android:radius="8dp"/>
<solid android:color="@color/dirtyWhite"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="8dp"/>
<solid android:color="@color/colorPrimaryDark"/>
</shape>
</clip>
</item>
Thanh tiến trình của tôi:
<ProgressBar
android:id="@+id/activeProgress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:progress="10"
android:progressDrawable="@drawable/rounded_corners_progress_bar"/>
Tôi đã thử thêm thuộc tính <size>
trên <shape>
trong <clip
để làm cho hình dạng tiến trình nhỏ hơn một chút nhưng không hoạt động. Ngoài ra, thanh tiến trình bằng phẳng và tôi muốn bị cong theo thiết kế. Những gì tôi cần phải thay đổi để đạt được thiết kế?
https://github.com/akexorcist/Android-RoundCornerProgressBar –