我很困惑看到导航抽屉上工具栏下面的暗条。我尝试了很多方法来删除它。但是,没有什么可以作为例外。你可以看到一个黑暗的矩形栏在家的顶部。
任何人都知道解决这个问题。请帮助我......
appbarlayout是,
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.jrs.medicare.DoctorHome">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<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.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_doctor_home" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
acitivity layout is,
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_doctor_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_marginTop="80dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/activity_doctor_home_drawer" />
</android.support.v4.widget.DrawerLayout>
答案 0 :(得分:0)
我想我可以帮忙, 使用app:elevation =“0dp” - 如果您使用的是支持库(用于支持旧版本的Android) 或者使用android:elevation - 如果你没有使用支持库。
答案 1 :(得分:0)
只需从android:layout_marginTop="80dp"
NavigationView
即可
像这样
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/activity_doctor_home_drawer" />
答案 2 :(得分:0)
我删除了黑条。
1)在NavigationDrawer中添加的Header文件的主布局中添加layout_marginTop =“ 60dp”(根据您的工具栏大小)。
2)从NavigationDrawer中删除marginTop。
答案 3 :(得分:0)
将此添加到主要活动
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
然后将padding_top添加到 在app_bar_main.xml
中