How to Customize the Layout (height and Width), and containership of layouts?

前端 未结 1 1216
太阳男子
太阳男子 2021-01-25 03:10

I have created a TableLayout with two rows where first row has one TextView and second row has two columns, first one has a ListView and

1条回答
  •  野性不改
    2021-01-25 03:31

    I don't think your current solution will work(because of the requirement for equal space(width and height) + the ListView presence). One solution is to use nested weights(which are bad for performance, but(probably, without knowing what you do) not something that important that will break your app) like in the layout below:

    
    
    
        
    
        
    
        
    
            
            
    
            
    
                
    
                

    Another option to avoid the nested weights problem is to use a RelativeLayout like below(I haven't tested it):

    
    
    
        
    
        
    
            
    
            
    
            
    
                
                
    
                
    
                    
    
                    

    The identical_layout layout file represents the common layout shared by your Activities.

    0 讨论(0)
提交回复
热议问题