How to set elevation to Bottom navigation

后端 未结 3 1431
误落风尘
误落风尘 2021-02-19 08:46

So by the support V25. We have new component called Bottom navigation.

Follow the Design guidelines, the Bottom Navigation\'s elevation should

3条回答
  •  轮回少年
    2021-02-19 09:35

    I had the same issue and to have a @android:color/white as OP suggested was not acceptable in my case. So since we "can't" get shadow with elevation and custom background we need to hack it.

    My approach is adding a shadow view inside the frame layout to "mimic" elevation.

    
    
    
    
    
    
        
    
        
    
    
    

    where the background of the shadow view is nothing more than a shape gradient that is positioned over all other just above the bottom nav view, something like:

    
    
        
    
    

    Hope this helps someone.

提交回复
热议问题