https://kotlinlang.org logo
#tornadofx
Title
# tornadofx
s

Shadab

03/29/2020, 8:18 PM
Hey there, I am working on a chat app, looking for a way to hide empty rows in listview so that if I have only 2 items in a list I see only those and not empty smartcells. Please help. Thanks.
s

sbyrne

03/30/2020, 11:18 AM
I had a very similar problem. The only solution I found was to just not put the items into the listview.
(Have the logic controller "hide" the items instead of having the view do it.)
s

Shadab

03/30/2020, 5:35 PM
hmm but that would add unnecessary scrolling if you have less items.
s

sbyrne

03/30/2020, 8:11 PM
Oh, I misunderstood your question.
Ignore everything I said.
You want the listview to shrink vertically so there are no empty rows?
s

Shadab

03/30/2020, 9:47 PM
yes, exactly or simply put, I want the listview to be as tall as number of items in it.
c

Carlton Whitehead

03/31/2020, 12:02 PM
If there's a small enough number of items in it to all fit on screen at once, why not just use a vbox?
s

Shadab

03/31/2020, 6:06 PM
Numbers of items is unknown. It can be 0 to any number.