我是否可以将AppBarLayout与持久性底页重叠

问题描述 投票:0回答:1

我想重叠一个AppBarLayout,其中包含一个带有持久性底部表单的工具栏(仅当处于展开状态时。请尽可能告诉我至少一个提示。

这是定义AppBarLayout的布局文件

<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"
tools:context=".MainActivity">
<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
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:fitsSystemWindows="true"
        android:minHeight="?attr/actionBarSize"
        app:title="Home"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:background="?attr/colorPrimaryDark">
    </android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>

包含的布局content_main是我的工作表所在的位置。

android android-appbarlayout navigation-drawer
1个回答
0
投票

我知道了。如果没有,bottomSheet将与工具栏重叠

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

appbarlayout使其必须在整个导航抽屉中显示(如果导航是片段的话。)>

© www.soinside.com 2019 - 2024. All rights reserved.