水平方向, 覆盖android:progressDrawable属性
<ProgressBar
android:id="@+id/process"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progressDrawable="@drawable/turnout_progressbar_horizontal"
android:progress="1" />
新建文件 turnout_progressbar_horizontal.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:gravity="center_vertical|fill_horizontal">
<shape android:shape="rectangle">
<!--android:tint="?attr/colorControlNormal">-->
<size android:height="4dp" />
<solid android:color="@color/color_CFDFF1" />
<corners android:radius="2dp" />
</shape>
</item>
<item
android:id="@android:id/secondaryProgress"
android:gravity="center_vertical|fill_horizontal">
<scale android:scaleWidth="100%">
<shape android:shape="rectangle">
<!--android:tint="?attr/colorControlActivated">-->
<size android:height="4dp" />
<solid android:color="@color/color_CFDFF1" />
<corners android:radius="2dp" />
</shape>
</scale>
</item>
<item
android:id="@android:id/progress"
android:gravity="center_vertical|fill_horizontal">
<scale android:scaleWidth="100%">
<shape android:shape="rectangle">
<!--android:tint="?attr/colorControlActivated">-->
<size android:height="4dp" />
<solid android:color="@color/color_0C72E3" />
<corners android:radius="2dp" />
</shape>
</scale>
</item>
</layer-list>