Change Height of a Listview dynamicallyAndroid

前端 未结 8 1689
借酒劲吻你
借酒劲吻你 2021-01-06 23:29

The format of my XML file is as following:

 LinearLayout 

     ScrollView

         RelativeLayout

             LinearLayout

             

        
8条回答
  •  太阳男子
    2021-01-07 00:12

    If you want to change the height of list view dynamically, you could use,

    list.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, theSizeIWant));
    

提交回复
热议问题