android:layout_height 50% of the screen size

前端 未结 10 913
无人共我
无人共我 2020-12-23 16:29

I just implemented a ListView inside a LinearLayout, but I need to define the height of the LinearLayout (it has to be 50% of the screen height).



        
10条回答
  •  庸人自扰
    2020-12-23 16:53

    You can use android:weightSum="2" on the parent layout combined with android:layout_height="1" on the child layout.

               
    
                    
    
                
    

提交回复
热议问题