0

I want to remove the extra space from the navigation bar to the bottom of my screen.

As you can see below:

enter image description here

My BottomNavigationView leaves some space below it and I have no idea why.

The layout that contains theBottomNavigationView is very simple:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
  android:id="@+id/layout"
  tools:context=".NavBarActivity">


<FrameLayout
    android:id="@+id/frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/menu"
    android:background="@drawable/scroll_background"/>

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/menu"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentStart="true"
        android:background="@drawable/main_color_background"
        app:itemIconTint="@color/secondaryTextColor"
        app:itemTextColor="@color/secondaryTextColor"
        app:menu="@menu/nav_items" />
</RelativeLayout>

I have checked that the problem is not coming from the custom background of the nav bar (I have checked it with some simple color and I got the same results)

Any ideas on why this is happening and how can I prevent it from happening?

Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53

2 Answers2

0

Why your navigation background is circular?

Have you used main_color_background for circular background?

Remove that background which is making it circular and try it again. May be you have added some padding/margin in those background, which are leaving space.

  • Thank you for your answer but as I wrote in my question - I have removed this round background and used simple solid color but this did not change this spacing – Tamir Abutbul May 04 '19 at 20:35
0

So this is a funny solution:

In my phone, (galaxy j7 pro-2017) by default, there is some kind of black thin frame around every app and well, everything.

So I never had a problem, it just the way the phone is made.

Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53