对于列表视图可见行设置最大数 [英] Set maximum number of visible rows for listview
问题描述
有没有设置数最大可见行的列表视图的方式?
Is there a way for setting a number of maximum visible rows for a listview?
非常感谢!
推荐答案
都做到了,我用自定义适配器,然后有我行的高度设置为我所需的高度。通过设置行的高度在列表视图我可以设置多少行,可初步显示等是滚动的,在这里我把列表视图的布局里面(相对或线性),然后我设置布局的高度,用你想看到多少行做多,EI行高度是50dp布局的高度应150dp如果你想3可见的行。
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.
这篇关于对于列表视图可见行设置最大数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!