首先,我知道之前已经问过这个问题,但之前没有得到回答.我希望有人能给我一个答案.
在我的应用程序中,我使用Appcompat_v7(API 21)中的工具栏.这是我的代码:
<android.support.v7.widget.Toolbar
style="@style/DarkActionbarStyle"
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="@dimen/actionbar_height" />
Run Code Online (Sandbox Code Playgroud)
这是我使用的ToolBar样式:
<style name="DarkActionbarStyle" parent="@style/Widget.AppCompat.Toolbar">
<item name="android:background">?attr/colorPrimary</item>
<item name="titleTextAppearance">@style/ActionBarTitle</item>
<item name="android:elevation">2dp</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="theme">@style/ThemeActionBarDark</item>
</style>
<style name="ThemeActionBarDark" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="actionBarItemBackground">@drawable/btn_dark_orange</item>
<item name="selectableItemBackground">@drawable/btn_dark_orange</item>
</style>
Run Code Online (Sandbox Code Playgroud)
问题是,提升前棒棒糖不起作用.所以我的问题是:棒棒糖设备上的工具栏下是否有阴影?
android toolbar shadow android-appcompat android-5.0-lollipop