Floating Toolbar with Appcompat

前端 未结 6 1178
半阙折子戏
半阙折子戏 2020-12-14 05:27

How to create a floating toolbar like the following image as proposed in the material design guidelines and in the Google Map application.

6条回答
  •  有刺的猬
    2020-12-14 05:52

    Since you are following the Material Design concept I am assuming your are using Coordinator Layout as your Main Layout and Not Frame Layout.

    Before anything else we need to declare the important dependencies.

    dependencies {
        compile 'com.android.support:design:22.2.1'
        compile 'com.android.support:cardview-v7:22.2.1'
    }
    

    Expected/Similar Output

    XML snippet

    
    
    
        
            
            
        
    
        
    
            
    
                
            
        
    
    
        
    
    
    

提交回复
热议问题