我想创建带有透明工具栏的抽屉导航,但最终工具栏上有阴影,如下所示
如何去除阴影?
我尝试提升高度,但它删除了所有整个工具栏,
<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>
有人愿意帮助我吗?
最佳答案
在您的 Activity 的 onCreate()
中尝试以下代码:
if(getSupportActionBar() != null)
{
getSupportActionBar().setElevation(0);
}
希望这有帮助
关于java - 抽屉导航透明工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43290925/