android - how to set the height of a listview when the activity is initialized -


my purpose set height of listview when activity initialized. height of listview less screen, , after intialized want height of listview , make height plus integer,then set listvview's height new number.

but when use listview.getmeasuredheight() or listview.getlayoutparams().height in oncreate or onstart or onresume.the answer zero. how can right answer?

i new android, help.

that seems weird. anyway, can place listview in viewgroup lik linearlayour, relativelayout , set listview height fill_parent. , set height of viewgroup outside.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -