我ViewPager内心面临一个重大的滚动问题CoordinatorLayout.
当前场景:
app:appbarScrollingViewBehaviour已开启ViewPager.ViewPager片段具有NestedScrollView其根父母.RecyclerView.RecyclerView,应用栏不会滚动,而是仅进行嵌套滚动.CoordinatorLayout滚动.6)嵌套滚动也在中途停止并切断内容.我已经尝试过了:
ViewPager里面NestedScrollView并设置 app:appbarScrollingViewBehaviour属性NestedScrollView.这完全切断了碎片内容,因为RecyclerView无法确定其高度.setAutoMeasureEnabled(true)上RecyclerView,依然没能解决的高度.RecyclerView行布局的代码.谢谢
activity.xml:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:Customs="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/new_color_primary_skim">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsingLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:elevation="0dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:minHeight="?attr/actionBarSize">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|enterAlways"
android:layout_height="?attr/actionBarSize">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView …Run Code Online (Sandbox Code Playgroud) android android-fragments android-recyclerview android-coordinatorlayout
我已经成功实现了一个循环计数为2的网格布局方式的回收站视图.现在我想实现如下图所示的内容.为此,我需要自定义我的网格布局管理器,使得1个元素的跨度计数为1,而对于休息,所有它都是2.无论如何都可以.
