我已经将我的片段中简单的 ProgressBar
替换为 ContentLoadingProgressBar
。
现在片段布局看起来像这样:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/simple_match_parent_style">
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
<TextView
android:id="@+id/txt_no_songs"
android:text="@string/txt_no_songs"
android:layout_centerInParent="true"
style="@style/txt_no_songs"/>
<ListView
android:id="@+id/list"
android:fastScrollEnabled="true"
android:divider="@null"
style="@style/simple_match_parent_style"/>
</RelativeLayout>
我在 onViewCreated
中展示了这个进度条:
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
progressBar = (ContentLoadingProgressBar) view.findViewById(R.id.progress);
progressBar.show();
...
}
为了测试目的,我已经删除了progressBar.hide()
的调用,以使进度条在任何情况下都能显示。但问题是我的ContentLoadingProgressBar
从未真正显示。
我应该做些什么来显示ContentLoadingProgressBar
吗?我没有找到任何相关使用ContentLoadingProgressBar
的例子,因此希望提供有用的示例。提前感谢。