一、xml設定
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="100sp"
android:layout_height="100sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.41" />
private ProgressBar pb;
pb = (ProgressBar) findViewById(R.id.pb);
三、設定進度表進度
pb.setProgress(pg);
四、進度條顯示及隱藏
pb.setVisibility(View.GONE);
pb.setVisibility(View.VISIBLE);
四、進度條顯示及隱藏
pb.setVisibility(View.GONE);
pb.setVisibility(View.VISIBLE);
沒有留言:
張貼留言