I don’t know I have tried changing the icon, changing the layout almost everything but cannot get rid of the white space under the bottom navbar.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/container"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/nav_items" />
</androidx.constraintlayout.widget.ConstraintLayout>
I tried changing the layout, contraints, changing the size of the bottom navigation bar but the icons disappear. I making the app in java with android studio.
2
Answers
In your nav_items check is there any padding to item then try removing them and set 0dp.
I recommend building your new custom bottom navigation bar on your own.
Add material cards and this will give you the actions ribble colors, and then add inside it constraint layout and build your item.
This will give you more flexibility