我創建了一個AppBar佈局這樣CoordinatorLayout和AppBarLayout海拔
<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再次顯示其陰影?
如何解決這個問題 –
http://stackoverflow.com/a/39247130/2158970 – Yuraj
https://stackoverflow.com/a/ 32393698/4542217 –