0

I have one problem with the BottomNavigationBar. Inexplicable margins from the edges of the screen appear like on the screen.

Here is my XML cod:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#FBCEB5">


    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/mainNavigationBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:itemBackground="@color/colorPrimary"
        app:menu="@menu/main_bottom_bar"
        app:itemIconTint="@android:color/white"
        app:itemTextColor="@android:color/white"/>

</RelativeLayout>

How i can put on all parent width ? Please help)

Black margins

Lemonyara
  • 53
  • 4

1 Answers1

0

According to this post, BottomNavigationView is not full width, the bottom navigation bar is not supposed to fill the entire width. Instead, you could set the background color of the view to be the same color as the items background:

<android.support.design.widget.BottomNavigationView
 android:background="@color/bottom_view_color"
 app:itemBackground="@color/bottom_view_color"

 // .... />