How do I use DrawerLayout to display over the ActionBar/Toolbar and under the status bar?

后端 未结 10 1075
[愿得一人]
[愿得一人] 2020-11-22 04:05

I\'ve seen in the new material design Side Nav spec that you can display the drawer over the action bar and behind the status bar. How can I implement this?

10条回答
  •  天命终不由人
    2020-11-22 04:25

    Try with this:

    
    
    
    
    
        
        
    
            
    
            
    
            
    
                
            
    
    
        
    
        
        
    
    
    
    
    
    
    
    
    
        
    
    

    style :

    
    

    Main Activity extends ActionBarActivity

    toolBar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolBar);
    

    Now you can onCreateOptionsMenu like as normal ActionBar with ToolBar.

    This is my Layout

    • TOP: Left Drawer - Right Drawer
      • MID: ToolBar (ActionBar)
      • BOTTOM: ListFragment

    Hope you understand !have fun !

提交回复
热议问题