i implemented a bottom navigation bar for my app. When simulating the app, it started giving me weird heights and when changing the height of the layout from wrap content to a certain height like 50dp, the navigation values or the icons disappeared with an empty space at the bottom.
It gives that weird big space at the bottom
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:fitsSystemWindows="true">
<View
android:id="@+id/BlueView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/edtTxtSearch"
android:layout_marginLeft="-10dp"
android:layout_marginRight="-10dp"
android:layout_marginBottom="-70dp"
android:background="@drawable/layout_bg"
/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottomNavigationView"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:theme="@style/Theme.MaterialComponents.DayNight"
app:labelVisibilityMode="labeled"
app:menu="@menu/nav_menu"/>
<EditText
android:id="@+id/edtTxtSearch"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="50dp"
android:layout_marginTop="150dp"
android:layout_marginBottom="695dp"
android:background="@drawable/search_bar"
android:hint="Search"
android:textColorHint="@color/Cedar"
android:inputType="text"
android:paddingLeft="13dp"
android:paddingTop="4dp"
android:textSize="11dp"
android:textStyle="bold"
android:fontFamily="@font/poppins"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Special Offers"
android:layout_alignTop="@+id/btnVouchers"
android:layout_marginTop="-17dp"
android:layout_marginLeft="35dp"
android:textSize="10dp"
android:textColor="@color/Clinker"
android:fontFamily="@font/montserrat"/>
<ImageView
android:id="@+id/btnVouchers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/btnServices"
android:layout_marginLeft="29dp"
android:layout_marginTop="77dp"
android:layout_marginRight="29dp"
android:background="@drawable/ic_launcher_background"
android:onClick="imageVoucher" />
<Button
android:layout_width="wrap_content"
android:layout_height="35dp"
android:textSize="9dp"
android:textStyle="bold"
android:text="Services"
android:layout_centerVertical="true"
android:layout_below="@+id/BlueView"
android:layout_marginTop="87dp"
android:layout_centerHorizontal="true"
android:id="@+id/btnServices"
android:background="@drawable/green_buttons"
android:textColor="@color/black"
android:gravity="right|center_vertical"
android:paddingRight="10dp"
android:fontFamily="@font/montserrat"/>
<Button
android:layout_width="wrap_content"
android:layout_height="35dp"
android:textSize="9dp"
android:textStyle="bold"
android:text="All"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnServices"
android:layout_marginRight="10dp"
android:layout_below="@+id/BlueView"
android:layout_marginTop="87dp"
android:layout_centerHorizontal="true"
android:id="@+id/btnAll"
android:background="@drawable/green_buttons"
android:textColor="@color/black"
android:gravity="right|center_vertical"
android:paddingRight="10dp"
android:fontFamily="@font/montserrat"
android:elevation="30dp"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="35dp"
android:textSize="8dp"
android:textStyle="bold"
android:lines="2"
android:text="LaundrynStore"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/btnServices"
android:layout_marginLeft="10dp"
android:layout_below="@+id/BlueView"
android:layout_marginTop="87dp"
android:layout_centerHorizontal="true"
android:id="@+id/btnLaundryStore"
android:background="@drawable/green_buttons"
android:textColor="@color/black"
android:gravity="right|center_vertical"
android:paddingRight="5dp"
android:fontFamily="@font/montserrat"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="18dp"
android:text="Welcome back, Guest!"
android:layout_below="@+id/BlueView"
android:fontFamily="@font/abril_fatface"
android:textColor="@color/Cedar"
android:textSize="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="37dp"
android:text="What service do you need?"
android:layout_below="@+id/BlueView"
android:fontFamily="@font/abril_fatface"
android:textColor="@color/Cedar"
android:textSize="10dp"/>
<RelativeLayout
android:layout_width="200dp"
android:layout_height="75dp"
android:id="@+id/rel_layouy_logo"
android:layout_above="@+id/edtTxtSearch"
android:layout_centerHorizontal="true"
android:layout_marginBottom="-153dp">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher_background"
android:id="@+id/PickNWashLogo"
android:layout_centerVertical="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/txtPickNWash"
android:layout_alignParentEnd="true"
android:layout_marginRight="13dp"
android:text="Laundry Delivery Service"
android:textColor="@color/Cedar"
android:textSize="9dp"
android:fontFamily="@font/abril_fatface"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:text="Pick N' Wash"
android:textColor="@color/Cedar"
android:textSize="20dp"
android:id="@+id/txtPickNWash"
android:fontFamily="@font/baron_neue"
/>
</RelativeLayout>
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/available_shop_card"
android:layout_below="@+id/btnAll"
android:layout_marginTop="200dp"
android:layout_centerHorizontal="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/shopsRecView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@+id/txtLaundryNearby"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp" />
<TextView
android:id="@+id/txtLaundryNearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:text="Laundry Near By"
android:textColor="@color/black"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginRight="40dp"
android:text="view all"
android:textColor="@color/CoolBlue"
android:textStyle="bold" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
i tried changing the theme but that doesnt seem to do anything.