Translucent status bar and toolbar

后端 未结 8 2042
醉梦人生
醉梦人生 2020-12-16 12:43

I\'d like to integrate something like this:

And I\'ve done it like this, but I can\'t seem to put the imageview below the toolbar. Without the toolbar, I ca

8条回答
  •  渐次进展
    2020-12-16 13:36

    As you said,

    "I've already tried putting the toolbar in a FrameLayout, but doing that my toolbar simply hides, like this:".


    The problem with this is the order of adding childView in FrameLayout, you added Toolbar as first child and after that you added ImageView. this is why image hides the toolbar. Instead, the order of views inside FameLayout should be like this

    
    
              
    
              
    
        
    

    Also for API level >=19 ,you can add this attribute in style.xml file to make statusBar transparent
    true
    For making content behind statusBar use this link

    https://developer.android.com/training/system-ui/status.html#behind

提交回复
热议问题