简体   繁体   中英

How to implement this bottom navigation bar

Hei I have the new android studio 4.1

I have imported a bottom navigation menu from git hub here this one

Now I have set up dependencies correctly I did all the things necessary but still, there are no actions in the navigation bar, the colour is not changing. even the menus are not displaying

here is the main activity code


     <me.ibrahimsn.lib.SmoothBottomBar
            android:id="@+id/bottomBar"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            app:backgroundColor="@color/colorPrimary"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:menu="@menu/menu" />
    
    
          </androidx.constraintlayout.widget.ConstraintLayout> 



this is the menu code
  

       <?xml version="1.0" encoding="utf-8"?>
            <menu xmlns:android="http://schemas.android.com/apk/res/android">
     
            <item android:id="@+id/home"
            android:title="Home"/>
    
            <item android:id="@+id/rank"
            android:title="Rank"/>
            </menu>  

now still the background is white see this: image still not changing在此处输入图像描述

Have you added this line in your layout parent tag:

xmlns:app = "http://schemas.android.com/apk/res-auto"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM