Ram*_*mar 3 android android-layout
我正在尝试使用ContentLoadingProgressBar实现进度条的水平不确定风格。下面是xml布局
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/pbar_Cloud"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_gravity="bottom"
android:visibility="visible" />
Run Code Online (Sandbox Code Playgroud)
进度条显示为水平的空白线,没有进度。通过设置
style="?android:attr/progressBarStyleLarge"
Run Code Online (Sandbox Code Playgroud)
循环不确定的进度显示很好。我想念的是什么,我什至尝试过
ContentLoadingProgressBar bar = (ContentLoadingProgressBar) findViewById(R.id.pbar_Cloud);
bar.setActivated(true);
bar.show();
Run Code Online (Sandbox Code Playgroud)
仍然没有运气。
我知道这是很久以前问过的,但是如果有人因同样的问题而来到这里:
您只需要添加android:indeterminate="true"到xml中:
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/pbar_Cloud"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_gravity="bottom"
android:visibility="visible"
android:indeterminate="true"/>
Run Code Online (Sandbox Code Playgroud)
希望有帮助!
| 归档时间: |
|
| 查看次数: |
2022 次 |
| 最近记录: |