android - 为什么recycleview不滚动折叠appbarlayout
问题描述
在我使用nestedSrollview 之前,appbarLayout 折叠得很好,但现在我使用recycleview 并且它不滚动
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bdbdbd"
android:fitsSystemWindows="false"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/discount_list_recycle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="true"
android:padding="@dimen/item_offset"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll" >
....
</android.support.v7.widget.Toolbar>
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.constraint.ConstraintLayout
android:id="@+id/slider_layout"
android:layout_width="match_parent"
android:layout_height="200dp" >
<android.support.v4.view.ViewPager
android:id="@+id/image_slider_view_pager"
....
/>
</android.support.constraint.ConstraintLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
当recycleview滚动并且工具栏没有进入时,我想折叠工具栏和viewpager总是对不起我的英语
解决方案
推荐阅读
- angular - Angular - 检测存储的组件是否已重新连接或分离
- python - 使用 Pandas 整理 Excel 工作表
- javascript - 为什么每次击键后react form的onSubmit都会触发,如何使用enter按钮提交表单?
- r - 如何解决 ggalluvial/ggplot2 中无法识别数据的问题?
- r - 如何在 R 中迭代的函数中包含停止规则?
- c# - Xamarin - 如何将来自 Rest API 的数据绑定到 StackLayout 而不是 ListView
- c++ - 大规模的可变声明成本是否可以忽略不计?
- apache-kafka - 卡夫卡消费者在心跳失败后离开小组
- javascript - Chrome 和 IE 不适用于 SameSite 属性?
- javascript - 检测逻辑表达式字符串中的标签