我正在尝试使用ContentLoadingProgressBar实现进度条的水平不确定风格.下面是xml布局
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" />
进度条显示为水平的空白线,没有进度.
通过设置
style="?android:attr/progressBarStyleLarge"
循环不确定的进度显示很好.我想念的是什么,我什至尝试过
ContentLoadingProgressBar bar = (ContentLoadingProgressBar) findViewById(R.id.pbar_Cloud);
bar.setActivated(true);
bar.show();
仍然没有运气.
解决方法:
我知道这是很久以前问过的,但是如果有人因同样的问题而来到这里:
您只需要将android:indeterminate =“ true”添加到您的xml中:
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"/>
希望有帮助!
标签:android-layout,android
来源: https://codeday.me/bug/20191027/1948464.html