[英]How to add View pager and recycler view under scroll view layout
我在RelativeLayout
下有RecyclerView
和ProgressBar
。 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_width
和layout_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.