簡體   English   中英

如何實現這個底部導航欄

[英]How to implement this bottom navigation bar

嘿我有新的android studio 4.1

我已經從 git 集線器這里導入了一個底部導航菜單

現在我已經正確設置了依賴關系,我做了所有必要的事情,但是導航欄中沒有任何操作,顏色沒有改變。 連菜單都沒有顯示

這是主要的活動代碼


     <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>  

現在仍然背景是白色的看到這個:圖像仍然沒有改變在此處輸入圖像描述

您是否在布局父標簽中添加了這一行:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM