What is the trick with 0dip layout_height or layouth_width?

后端 未结 3 1797
孤城傲影
孤城傲影 2020-12-05 15:00

I mean why anybody want they view to be 0dip height ? I have seen this many times, there must be some kind of trick, but I do not get it.

        

        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 15:37

    This is usually used when having many views inside a linearlayout and have set android:layout_weight="1" in order both views to take equal space. for example:

    
    
        
    
        
    
    
    

    In that case, the view will take as much height as all other views.

提交回复
热议问题