注意必须设置style:
1 <android.support.v4.widget.ContentLoadingProgressBar 2 android:id="@+id/progressBar" 3 android:layout_width="16dp" 4 android:layout_height="16dp" 5 android:layout_marginTop="10dp" 6 android:layout_marginEnd="30dp" 7 kongqw:layout_constraintEnd_toEndOf="parent" 8 kongqw:layout_constraintTop_toBottomOf="@+id/switch1" 9 style="@style/Base.Widget.AppCompat.ProgressBar" />
设置进度条颜色:
1 //设置扫描进度条的颜色 2 mProgressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(this,R.color.bt_progressBar), PorterDuff.Mode.MULTIPLY);