簡體   English   中英

導航抽屜透明工具欄

[英]Navigation Drawer Transparent Toolbar

我想用透明的工具欄創建導航抽屜,但最終在這樣的工具欄上留下陰影 在此處輸入圖片說明

如何去除陰影?

我嘗試使用高程,但是它刪除了所有的工具欄,

<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:id="@+id/mAppBarLayout"
        android:fitsSystemWindows="false"
        android:layout_height="wrap_content">

            <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.ActionBar.Transparent" />
    </android.support.design.widget.AppBarLayout> 

有人介意幫我嗎?

在您的活動的onCreate()中嘗試以下代碼:

if(getSupportActionBar() != null)
{
   getSupportActionBar().setElevation(0);
}

希望這可以幫助

暫無
暫無

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

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