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
Post a Comment