Tôi có bố cục như sau:
<android.support.design.widget.CoordinatorLayout
    android:id="@+id/main_content"
    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.support.design.widget.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
    </android.support.design.widget.AppBarLayout>
    <FrameLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</android.support.design.widget.CoordinatorLayout>
Tôi thêm Fragments vào FrameLayout, thay thế chúng. Một trong những Fragmentdanh sách của tôi là một danh sách, có bố cục như sau:
<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
Vấn đề của tôi ở đây là thanh công cụ được vẽ qua danh sách . Tôi đã cố gắng giải quyết điều đó bằng cách gói nội dung của CoordinatorLayoutmột LinearLayout, điều đó đã giải quyết việc rút tiền, nhưng theo cách đó, hành vi cuộn của thanh ứng dụng không còn hoạt động.
Bất kỳ sự giúp đỡ nào cũng được đánh giá cao!
Fragmentchứa bằng một danh sách bằng một danh sách khácFragment. Tôi quản lý để hiển thị thủ công thanh công cụ theo cách này .