簡體   English   中英

使用自定義 xml 的 Material 操作欄背景

[英]Material action bar background using a custom xml

在此處輸入圖片說明

嗨,我需要為我的自定義視圖背景制作一個動作欄,我嘗試使用

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item>
    <shape android:shape="rectangle">
        <solid android:color="@color/button_gradient" />
    </shape>
</item>
<item android:top="1dp">
    <shape android:shape="rectangle">
        <solid android:color="@color/list_pressed" />
    </shape>
</item>
<item
    android:bottom="1dp"
    android:top="1dp">
    <shape android:shape="rectangle">
        <solid android:color="@color/menu_label" />
    </shape>
</item>

但我沒有得到這段代碼的陰影。 我應該改變什么才能得到陰影?

不推薦使用 ActionBar。 切換到工具欄,你應該得到你的影子。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM