#Kotlin! Bottom navigation view does not work

4 messages · Page 1 of 1 (latest)

silk shale
#

main_activity.xml:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/primaryColor"
android:layout_height="match_parent">

<FrameLayout
    android:id="@+id/frame_layout"
    android:layout_width="0sp"
    android:layout_height="wrap_content"
    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="56dp"
    app:itemIconTint="@color/black"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:menu="@menu/bottom_nav_menu">


</com.google.android.material.bottomnavigation.BottomNavigationView>

</androidx.constraintlayout.widget.ConstraintLayout>

bottom_nav_menu.xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
    android:id="@+id/Discover"
    android:icon="@drawable/baseline_search_24"
    android:title="Discover" />
<item
    android:id="@+id/Home"
    android:icon="@drawable/baseline_home_24"
    android:title="Home" />
<item
    android:id="@+id/Profile"
    android:icon="@drawable/baseline_account_circle_24"
    android:title="Profile" />

</menu>

fiery pebbleBOT
#

This post has been reserved for your question.

Hey @silk shale! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

pallid hill
#

You should be more descriptive about what you want, don't just paste code and expect people to know what's wrong, code and a screenshot isn't enough.