In my application i want use BottomNavigationView
view to show some fragments.I have 4 fragments
and i set this fragments
into BottomNavigationView
.
I write below codes but in large device screens such as Tables show me this items in center of BottomNavigationView
.
such as below image :
But i want show this items fill of BottomNavigationView
, such as below image :
My XML codes :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/container"
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"
tools:context=".MainActivity">
<fragment
android:id="@+id/mainNavigationFragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
android:layout_above="@+id/bottomNavigationView"
app:navGraph="@navigation/navigation_graph"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
android:layout_alignParentBottom="true"
app:menu="@menu/navigation"/>
</RelativeLayout>
How can i change my codes for show items such as image two?