android - 禁用 android CoordinatorLayout 滚动行为

标签 android android-recyclerview android-coordinatorlayout

当使用 coordinatorLayout 向布局添加滚动行为时,如下所示:

<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:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <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/AppTheme.PopupOverlay" />

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

    <FrameLayout
        android:id="@+id/mainContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">
    </FrameLayout>

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

mainContent 是重要的部分。

真正的布局将在这个容器内膨胀。

假设我的 View 由一个 RecyclerView 和屏幕底部的固定布局组成。

有人知道如何去除底部固定布局的滚动行为并保留RecyclerView-Toolbar-隐藏行为吗?

最佳答案

在“CoordinatorLayout”中,滚动的 View 必须首先出现,并且只能在不可滚动的 View 之后出现。我设法通过将我的不可滚动布局放在“mainContent”之外,就在它下面来解决这个问题

关于android - 禁用 android CoordinatorLayout 滚动行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35486168/

相关文章:

javascript - 检测安卓设备

android - ScrollView 魔术中的ListView

android - 如何在android的recyclerview中左右滑动

更改 fragment 后隐藏的Android FAB HideBottomViewOnScrollBehavior statys

android - 在自定义 View 中使用 Broadcast Receiver 的替代方法是什么?

android - 保留 fragment 的 ButterKnife 内存是否安全?

android-recyclerview - 转到其他片段后数据列表重复(滑动选项卡)

android recyclerview 加载更多按钮

android - 底部的元素使用 AppBarLayout 在导航栏后面绘制元素

android - 如何正确实现 Snackbar、Coordinator Layout 和 bottom|right FAB?