[英]How can I use listview inside a scrollview in android?
您可以使用以下示例的recyclerview:
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_collapseMode="pin">
<!-- Some views-->
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_bubhub_comment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
如果您需要同時滾動兩個布局,則可以在recyclerview中使用以下屬性。 否則,它將作為單個滾動視圖工作。 這些屬性允許Recyclerview
在NestedScrollView
滾動
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.