android:layout_height 50% of the screen size

前端 未结 10 927
无人共我
无人共我 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 17:12

    best way is use

    layout_height="0dp" layout_weight="0.5"

    for example

    
    
    
    

    WebView,TextView have 50% of the screen height

提交回复
热议问题