How to create vertical BottomNavigationView android?

后端 未结 5 1916
小蘑菇
小蘑菇 2021-02-08 16:06

I have an activity that have 4 fragment on top and BottomNavigationView with 4 items on bottom. It is working fine in mobile devices. When i go for tablet with LANDASCAPE i want

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-08 16:22

    You cant move the BottomNavigationView to left area of the layout.

    BottomNavigationView does not meet tablet material design specification

    The only way is You need to check the screen orientation on the start like

    if (islandcape()){
    
    //Create the Navigation view layout here.. 
    
    }else{
    
    //Create the BottomNavigationView layout here .. 
    
    }
    

    Note: You need to write a function to check the orientation and replace the islandcape() in the above code

    Also try the bellow library that will do the job neatly.

    Iiro Krankka https://github.com/roughike/BottomBar

提交回复
热议问题