【发布时间】:2018-11-07 06:42:18
【问题描述】:
我有以下活动
<?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>
在框架布局内查看
<?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 中,但滚动的性能很糟糕 - 它非常滞后,并且当我尝试向下滚动回收站视图时它会隐藏工作表。
如何解决这个问题?
【问题讨论】:
标签: android android-recyclerview android-coordinatorlayout