How to create Google + cards UI in a list view?

前端 未结 7 1026
独厮守ぢ
独厮守ぢ 2020-12-12 11:15

I want to create a listView of cards, but after reading this blog post goolge-plus-layout, I\'m cards are a viable solution for a list of anything. The animation part seems

7条回答
  •  暖寄归人
    2020-12-12 11:56

    You can create a custom drawable, and apply that to each of your listview elements.

    I use this one for cards in my UI. I don't think there is significant performance issues with this approach.

    The drawable code (in drawable\big_card.xml) looks like this:

    
    
    
        
            
                
            
        
        
            
                
    
                
            
        
        
            
                
    
                
            
        
    
    
    
    

    I apply the background to my listview elements like this:

    
    

    If you want to add this as a background to any View (not just a list), you just make the custom drawable that View's background element:

    
    

提交回复
热议问题