0
我正在嘗試從不確定水平進度條更改爲確定水平進度條,但確定性進度條無法在不確定的情況下正常工作。Android水平確定進度條未運行
確定一個出現但沒有動作。 請幫助我。
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/check"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ProgressBar
android:id="@+id/my_progressBar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:indeterminate="false"
android:max="100"
android:progress="10"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
而我加入MainActivity.java如下:
ProgressBar progressBar = (ProgressBar) findViewById(R.id.my_progressBar);
progressBar.setProgress(20);
進度從20開始並不增加? – Diekrul
@Diekrul是它停留在那裏,並沒有增加 – user3518835