简体   繁体   中英

Android : get List item height of a custom adapter

i'm using list view within a scrollview. To avoid the list view not scrollable, i need to het the height of list item and set the listview's height. How to get the list item height while using custom adapter?

Remove the parent scrollview... keep the listview as it is... and change height of listview to fill_parent then automatically as new items are populated in the list you can scroll through it to view ones that go out of the screen ... If by setting to fill_parent the ListView forces other views out of the screen manually set the Height by draging the edges in the graphical layout . Either ways no need to use the ScrollView

thanks to @Lalit for pointing out the hazards of setting a ListView to wrap_content

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM