Android: Appcompat 21 how to add shadow on actionbar

后端 未结 4 968
梦如初夏
梦如初夏 2020-12-23 00:25

I add the new material design actionbar from the new appcompat and I use the new toolbar widget. I set a custom background on the toolbar on xml but my problem is that the d

4条回答
  •  醉话见心
    2020-12-23 00:39

    This is how I display the shadow:

    
    
    
        
    
    
    
    
        
        
        
    
    

    And then the topshadow layout looks like this (adjust the 5dp to get the shadow height you want):

    
    

    background_shadow.xml

    
    
        
    
    

    toolbar_actionbar.xml

    
    

提交回复
热议问题