【发布时间】:2018-11-02 06:15:56
【问题描述】:
我有一个 AppBarLayout ,其中包含一个 FrameLayout ,其中包含一个 ImageView 。 FrameLayout 本身位于 CollapsingToolbarLayout 中。 在 AppBarLayout 的底部,有一个 RecyclerView。
代码如下
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="ifContentScrolls">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/img_video_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<ImageView
android:id="@+id/cropper_view"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="#ff282828"
android:visibility="visible"/>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/img_video_view"/>
当用户触摸 AppbarLayout 部分时,我不想滚动发生。我希望仅在用户触摸 recyclerview 时向上滚动。 我该怎么做?
提前致谢。
【问题讨论】:
标签: android android-recyclerview material-design android-coordinatorlayout android-appbarlayout