How to disable BottomNavigationView shift mode?

后端 未结 21 2250
Happy的楠姐
Happy的楠姐 2020-11-22 15:55

BottomNavigationView doesn\'t show menu\'s title that are inactive.

How to show titles of all menu elements in bottomNavigationBar? The problem is that in my case s

21条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 16:31

    You can use this for showing both text and icons on BottomNevigationView for 3 to 5 items and stop shifting.

     app:labelVisibilityMode="labeled"
    

    But you will will face a problem of long text cutting on BottmNevigationView for 5 items. for that ,I found a good solutions for stop shifting of text as well as icons of BottomNevigationView. You can also stop shifting of text as well as Icons on BottomNevigationView also. Snipshots of code is given here.

    1. Add this some line of code in BottomNevigationView as shown

    
    

    2. Add Menu Items like as follows:-

     
    
    
        
    
        
    
        
    
        
    
        
    
    
    

    3.Add this style in style.xml file:

     
    

    4)Add these in Dimen folder

    
    
        10sp
        10sp
    
    

    I got help from these link and link .You can also get get help by studying these links.This helps me a lot.Hope this also help you. Thanks....

提交回复
热议问题