Reputation: 3691
I have drawer implemented in my app which is limited items. But i can see some dark bar at the bottom.
Here is the code
<?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="false"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="210dp"
android:layout_height="match_parent"
android:background="#252525"
android:layout_gravity="start"
android:fitsSystemWindows="false"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
app:itemTextColor="#a4a4a4"
/>
</android.support.v4.widget.DrawerLayout>
activity_main_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/nav_profile"
android:icon="@drawable/ic_menu_profile"
android:title="Profile"/>
<item
android:id="@+id/nav_history"
android:icon="@drawable/ic_menu_history"
android:title="History" />
<item
android:id="@+id/nav_help"
android:icon="@drawable/ic_menu_help"
android:title="Help" />
<item
android:id="@+id/nav_setting"
android:icon="@drawable/ic_menu_settings"
android:title="Settings"/>
</menu>
Already tried android:fitsSystemWindows="true" for parent and child and alone. No use of it. Can any one help, how to solve this issue.
I am attaching the screenshot
Upvotes: 2
Views: 444
Reputation: 1030
step 1:update this code in activity_main.xml (add app:insetForeground="@null"
)
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="210dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:fitsSystemWindows="false"
app:insetForeground="@null"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
step 2: just place this code in Mainactivity
setContentView(R.layout.activity_main);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
Upvotes: 4