我已经创建了这样的 AppBar 布局
<android.support.design.widget.AppBarLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appbar_layout"
android:layout_height="@dimen/app_bar_height"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="20dp">
<android.support.design.widget.CollapsingToolbarLayout...>
</android.support.design.widget.AppBarLayout>
它工作并在 LinearLayout 中投下阴影:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/app_bar_large" />
</LinearLayout>
然而,当我把它放入 CoordinatorLayout 时,阴影消失了:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/app_bar_large" />
</android.support.design.widget.CoordinatorLayout>
我怎样才能让 appbar 再次显示它的影子?