Recyclerview внутри макета координатора не прокручивается - PullRequest
0 голосов
/ 28 мая 2018

У меня есть следующее действие

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    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:id="@+id/coordinator">

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorWhite"
    android:id="@+id/catalog_view">

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginTop="79dp"
        android:background="@color/gray238"
        android:id="@+id/top_separator"/>

    ..

</android.support.constraint.ConstraintLayout>

    <include layout="@layout/check_view_sheet"/>

</android.support.design.widget.CoordinatorLayout>

check_view_sheet

    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/check_bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="500dp"
    android:background="@color/colorWhite"
    android:orientation="vertical"
    app:behavior_hideable="false"
    app:behavior_peekHeight="80dp"
       app:layout_behavior="android.support.design.widget.BottomSheetBehavior">


    <FrameLayout
         app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
        android:layout_width="400dp"
        android:layout_height="235dp"
        android:id="@+id/catalog_view_check_fragment"
        />

    <TotalView.TotalView
        android:layout_width="match_parent"
        android:layout_height="@dimen/totalViewHeight"
        android:id="@+id/catalog_total_view" />

</LinearLayout>

Просмотр внутри framelayout

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/check_recycler_view"
        android:paddingBottom="@dimen/checkBottomPadding"
        android:clipToPadding="false"
        app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

    </android.support.v7.widget.RecyclerView>

</android.support.constraint.ConstraintLayout>

Проблема заключается в том, что представление рециркулятора не прокручивается.

Я попытался обернуть framelayout в nestedScrollView, но производительность прокрутки ужасна - она ​​очень запаздывающая и скрывает лист, когда я пытаюсь прокрутить вид переработчика вниз.

Как это можно исправить?

1 Ответ

0 голосов
/ 28 мая 2018

Поскольку вы пытаетесь выполнить вложенную прокрутку, нижний лист имеет прокручиваемое поведение.

Попробуйте это в RecyclerView

android:nestedScrollingEnabled="true"

, если прокрутка на нижнем листе действительно обязательна, в противном случае попробуйте установить егона «ложь».

...