如何在RecyclerView上有ViewPager,或者在ScrollView中有多个RecyclerViews?我设计了以下布局,但滚动时出现一些问题。 什么问题,我该如何解决?如何在Android中设计复杂的用户界面
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#dcdcdc"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".ActivityMain"
tools:showIn="@layout/app_bar_main">
<LinearLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="200dip"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</ScrollView>
我试图compile 'com.bartoszlipinski:recyclerviewheader2:2.0.1'
与
<com.bartoszlipinski.recyclerviewheader2.RecyclerViewHeader
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top">
1-首先它支持11 SDK或更大,
2-其次ViewPager
在头RecyclerView
不会工作。 和我试过RecyclerView
layout_width="wrap_content"
但它只是在sdk21中支持。
我该如何解决RecyclerView的滚动问题?
任何帮助将不胜感激。 – HPbyP