Android - 工具栏重叠锚

asf*_*asf 0 xml android android-layout

我希望ImageView位于我的工具栏和内容之间(带有内容的布局).工具栏无法展开.

我怎样才能做到这一点?

我是这样做的:

    <?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"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">

        <android.support.design.widget.AppBarLayout
           android:id="@+id/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:popupTheme="@style/AppTheme.PopupOverlay"
               app:titleTextAppearance="@style/AppTheme.ToolbarText" />
        </android.support.design.widget.AppBarLayout>

        <android.support.percent.PercentRelativeLayout
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:layout_marginTop="?attr/actionBarSize"
           android:orientation="vertical">

            <android.support.percent.PercentRelativeLayout
               android:id="@+id/viewB"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:background="@drawable/advantages_background"
               app:layout_heightPercent="100%">

                ....
            </android.support.percent.PercentRelativeLayout>
        </android.support.percent.PercentRelativeLayout>

        <FrameLayout
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           app:layout_anchor="@id/appBarLayout"
           app:layout_anchorGravity="bottom|center">

            <ImageView
               android:id="@+id/fab"
               android:layout_width="70dp"
               android:layout_height="70dp"
               android:src="@drawable/advantages_circle" />
...
        </FrameLayout>
    </android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

我得到了这个(工具栏与我的圆圈重叠):

图片

我该如何解决?

我想ImageView(我的FrameLayout)重叠工具栏(锚)

Ani*_*nil 5

将此行添加到framlayout

android:elevation="20dp"
Run Code Online (Sandbox Code Playgroud)