Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottom Navigation View With Left Righ Space Issue

I am newbie in android, i am use bottom navigation view with two menus

but im getting left right space

Here is my Navigation View,

<android.support.design.widget.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"

        app:itemBackground="@color/colorRed"
        app:itemIconTint="@color/colorWhite"
        app:itemTextColor="@color/colorWhite"
        app:menu="@menu/bottom_bar_menu"/>

Please check Image enter image description here

like image 452
Dhara Avatar asked May 04 '17 08:05

Dhara


People also ask

How do I adjust the navigation bar at the bottom?

To create a Menu, first, create a Menu Directory by clicking on the app -> res(right-click) -> New -> Android Resource Directory and select Menu in the Resource Type. To create a Menu Resource File , click on the app -> res -> menu(right-click) -> New -> Menu Resource File and name it bottom_nav_menu.

How do I hide the bottom of my navigation?

Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


2 Answers

According to Material design guidelines You can't use two menus with bottom navigation use, instead of bottomNavigation view use tab layout Check this link for guidlines https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-usage

Still, if you want to use bottom navigation view

Try This inside BottomNavigationView

android:background="@color/colorRed"
like image 81
EcoLover Avatar answered Oct 03 '22 17:10

EcoLover


Solution

Inside BottomAppBar set attribute

android:padding="0dp"
like image 20
Developer534255 Avatar answered Oct 03 '22 17:10

Developer534255