簡體   English   中英

如何在滾動視圖布局下添加View尋呼機和回收站視圖

[英]How to add View pager and recycler view under scroll view layout

我在RelativeLayout下有RecyclerViewProgressBar ProgressBar顯示在中心,直到RecyclerView數據加載為止。 我想在RecyclerView頂部和底部實現ViewPager ,以便可以輕松滾動整個視圖。

這是我到目前為止所做的:

<ProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/progress2"
    android:layout_centerInParent="true"/>

<android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/refresh">

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

    </android.support.v4.widget.SwipeRefreshLayout>

</RelativeLayout>

有人請讓我知道如何制作所需的布局。 任何幫助,將不勝感激。

謝謝

更改layout_widthlayout_height之后嘗試如下:

<ProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/progress2"
    android:layout_centerInParent="true"/>

<android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/refresh">

    <android.support.v7.widget.RecyclerView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
        android:id="@+id/recycle"/>

    </android.support.v4.widget.SwipeRefreshLayout>

</RelativeLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM