Android:我的RecyclerView中不支持页脚布局重力

时间:2015-11-10 08:53:54

标签: android layout android-recyclerview

这是我的RecyclerView的布局:

<com.xxx.mobile.ui.widget.list.PagingRecyclerView
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/list"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/background"
  android:clipToPadding="false"
  android:paddingTop="16dp" />

我使用此布局在我的RecyclerView中添加类似页脚:

loading_view.xml

<LinearLayout android:id="@+id/loading_view"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">

<ProgressBar
    android:id="@+id/loading_spinner"
    style="?android:progressBarStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

它工作正常,但progressBar不是水平居中......

Ps:我的RecyclerView在初始化时使用LinearLayout:

myRecyclerView.setHasFixedSize(true);

    LinearLayoutManager mLayoutManager = new LinearLayoutManager(this.getActivity());
    myRecyclerView.setLayoutManager(mLayoutManager);

感谢您的帮助!

0 个答案:

没有答案