Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set maximum number of visible rows for listview

Tags:

android

Is there a way for setting a number of maximum visible rows for a listview?

like image 530
Gratzi Avatar asked Nov 05 '22 07:11

Gratzi


1 Answers

have done it, I used custom adapter and then there i set the height of the row the to my desired height. by setting up the height of the row in listview i can set how many rows can be initially displayed and others are scrollable, where i place the listview inside a layout(relative or linear) and then i setup the height of the layout, with the multiple of how many rows do you want to be seen, ei row height is 50dp your layout height should be 150dp if you want 3 visible rows.

like image 62
niczm25 Avatar answered Nov 15 '22 08:11

niczm25