Why does the LinearLayout attribute “layout_weight” seem to do the opposite of what I think it should do?

后端 未结 3 1315
无人及你
无人及你 2021-01-18 07:58

I\'m following this tutorial to learn about linear layouts. Here\'s the main layout file:




        
3条回答
  •  滥情空心
    2021-01-18 08:18

    layout_weight is normally used with layout_width or layout_height set to wrap_content. Try it, you'll see that it then increases the layout sized based on which view has the higher weight.

    Example

    
    
      
          
    
      
    
      
        
    
      
    
    
    

提交回复
热议问题