如何在4.4之前的设置适配器后添加页脚视图

时间:2017-01-14 19:24:07

标签: android listview android-adapter android-adapterview

我在setAdapter之后附加了页脚,现在它在KitKat中运行良好,但它在KitKat版本之前不起作用。

我得到的解决方案来自this所以问题是:

  1. addFooterView(页脚);
  2. setAdapter(适配器);
  3. removeFooterView(页脚);
  4. 但我想在setAdapter之后添加页脚视图。

1 个答案:

答案 0 :(得分:0)

为什么不在列表视图上显示视图。

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <SomeView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignBottom="@+id/recyclerView" />

</RelativeLayout>