BottomNavigationView

BottomNavigation is Menu.xml

Everyone page is Fragment

Step1: Create

Create a menu directFolder and create menu_nav.xml

everyone item need icon . id . title

Create NavigationView on activity_main.xml and add attribute menu in navigation

Step2:Write Code

Note

onNavigationItemSelected  must be turn true , the select with hight light

Step3:How many menu_item , How many Fragment

Create Home , Dashboard , Notify Fragment , write singleton and override OnCreatedView

just like this : Fragment

Code

https://github.com/encorex32268/blogthing/tree/master/TestBottomNavigation/app/src/main/java/com/lee/testbottomnavigation

Result:

With FloatingActionButton BottomCenter

Pull FloatingButton on BottomCenter , set Constraint , set elevation to Max

Fix menu.xml  , create empty item to center

Result:

 

 

最後修改日期: 2019-04-30 18:57:50

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料