【问题标题】:destroying shadow DrawLayout破坏阴影 DrawLayout
【发布时间】:2016-10-11 10:15:42
【问题描述】:

下图显示我的工具栏上有一个阴影。

如何移除此阴影并将我的菜单放在工具栏下方?

这是我的工具栏代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar               xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#2196F3"
android:layoutDirection="ltr"
android:textDirection="rtl"
app:popupTheme="@style/AppTheme.PopupOverlay" />

这是我的幻灯片菜单代码:

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">



<android.support.v4.widget.DrawerLayout
android:id="@+id/my_drawerlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<!-- your content layout -->
<include layout="@layout/activity_list"/>

<android.support.design.widget.NavigationView
    android:layout_marginTop="61dp"
    android:id="@+id/my_navigation"
    android:layout_width="250dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:layoutDirection="ltr"
    app:headerLayout="@layout/drawer_header"
    app:menu="@menu/drawer"/>

【问题讨论】:

  • 你指的是什么影子?
  • 我没听懂你的问题……抱歉
  • Toolbar移动到“幻灯片菜单代码”,在RelativeLayout XML内部,但在DrawerLayout之外,并将其与顶部对齐,DrawerLayout在其下方.

标签: android material-design navigation-drawer toolbar android-toolbar


【解决方案1】:

试试这个

yourDrawerLayout.setScrimColor(Color.TRANSPARENT);

【讨论】:

  • 我相信问题是要求将抽屉放在工具栏下以及删除阴影
猜你喜欢
  • 1970-01-01
  • 2011-03-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多