Kotlin Android app has a BottomNavigationView on the initial fragment. When the app is run the first icon of 5 in the view shows but the remaining icons/labels only show when that (blank) part of the navigation bar is clicked. app:labelVisibilityMode=”labeled” is set as indicated.
Here is the main fragment containing the BottomNavigationView:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/StartPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
tools:context=".StartPage">
<ImageView
android:id="@+id/ivBackgroundImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>
<Button
android:id="@+id/btnSendCard"
style="@style/btnTheme"
android:layout_width="175dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textSize="24dp"
android:text="Send Card!"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottomNavigationView"/>
<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_constraintStart_toStartOf="parent"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_nav_menu"
app:itemIconSize="24dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
And here is the bottom_nav_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/PaymentFragment"
android:visible="true"
android:enabled="true"
android:icon="@drawable/baseline_contact_mail_24"
android:title="@string/buyCards" />
<item
android:id="@+id/bottomNavPhotos"
android:visible="true"
android:enabled="true"
android:icon="@drawable/baseline_insert_photo_24"
android:title="@string/photos" />
<item
android:id="@+id/bottomNavContacts"
android:visible="true"
android:enabled="true"
android:icon="@drawable/baseline_contact_page_24"
android:title="@string/contacts" />
<item
android:id="@+id/bottomNavSchedulingDays"
android:visible="true"
android:enabled="true"
android:icon="@drawable/baseline_calendar_month_24"
android:title="@string/scheduling" />
<item
android:id="@+id/bottomNavSetOwner"
android:visible="true"
android:enabled="true"
android:icon="@drawable/baseline_account_circle_24"
android:title="@string/account" />
</menu>