Custom view that splits layout diagonally with different child views

后端 未结 3 1048
我寻月下人不归
我寻月下人不归 2020-12-28 23:25

How can i split LinearLayout or RelativeLayout diagonally into two varying sizes and each having different child view. Example ViewPager

3条回答
  •  盖世英雄少女心
    2020-12-29 00:16

    I think i am bit late for this answer, But you should see this amazing tutorial for this. Its easy and without any external library. The output will be like:

    You need to add layer-list

    
    
        
        
            
        
    
        
            
                
                    
                
            
        
    
    

    Now you just need to add this drawable into your layout.

    layout will be like:

    
    
            
    
                
    
                    
    
                        
    
                        
                            
                                
    
                                
                            
    
                            
    
                                
    
                                
                            
                        
                    
    
                    
                
            
    
    
        
    

    Must check this link for better understanding.

提交回复
热议问题