В xml
разметку добавил BottomNavigationView
, но почему-то он обрезан по бокам и текст не отображается.
Как сделать, чтобы он был растянут на всю ширину и можно ли уменьшить размер текста, чтобы текс и иконки всегда отображались?
Разметка
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:background="@drawable/background"
android:orientation="vertical"
tools:context=".activity.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvList"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isScrollContainer="true"
app:itemBackground="@color/colorWhite"
app:menu="@menu/bottom_menu" />
</LinearLayout>
</LinearLayout>
Скриншот
Видно что BottomNavigationView
не достает до краев, не могу понять почему.