Change height of list items in listview dynamically

83 views
Skip to first unread message

Thomas Schulz

unread,
Oct 20, 2016, 5:10:24 AM10/20/16
to Kivy users support
I have a list of text entries in a listview with different length. Some texts need two lines some only one.
How could I change the hight of the items dynamically?

Oon-Ee Ng

unread,
Oct 20, 2016, 5:20:29 AM10/20/16
to kivy-...@googlegroups.com
You shouldn't be using listview anymore (as its deprecated), go for
recycleview instead. If you're interested search the bugtracker, I did
bring up this problem with listview (and submit a working patch[1] for
it), but as it was deprecated it wasn't really worth the time to clean
it up.

For recycleview, I tacked on a short example of a dynamically changing
(height) recycleview[2] in my previous questions on slow ListViews.
Note that this was using the older garden recycleview, there's been
some changes which I haven't digested in the current official
recycleview implementation in master.

[1] - https://github.com/kivy/kivy/issues/3982#issuecomment-198289774
[2] - https://groups.google.com/forum/#!topic/kivy-users/kInk4SLrt5c

On Thu, Oct 20, 2016 at 5:10 PM, Thomas Schulz <kwa...@gmail.com> wrote:
> I have a list of text entries in a listview with different length. Some texts need two lines some only one.
> How could I change the hight of the items dynamically?
>
> --
> You received this message because you are subscribed to the Google Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Thomas Schulz

unread,
Oct 20, 2016, 6:33:28 AM10/20/16
to Kivy users support
Thanks for your advice. I was unsure with recycleview in the past, because it is labeled as experimental.
Besides listview (actually dictview) works good for me. The only issue I have is with dynamically height adaption.
But I will look into your examples and give recycleview a try.

ZenCODE

unread,
Oct 20, 2016, 6:05:30 PM10/20/16
to Kivy users support

@on-Ee Ng

Nice. We are currently working on the RecycleView docs and, not having used them much (we roll our own lazy-loading paged/scroll views) I'm also a bit unclear as to how it all mentally fits together.


I've seen you are quite active here, and as you get to grips with the RecycleView, it would be great to add some more complete examples and explanations of the basics. It you can post your findings and explanations, I would love to add these to the docs.


Let's make Kivy the silver bullet it could be :-)

Oon-Ee Ng

unread,
Oct 24, 2016, 12:59:25 AM10/24/16
to kivy-...@googlegroups.com
Oh, sure thing. I'm only active here because I'm currently working on
a personal project with Kivy, and following the OP actually spent a
few hours looking at RecycleView. It's not actually very complicated I
think, but the docs are a bit sparse.

What sort of form would you like, in terms of examples/documentations?
Reply all
Reply to author
Forward
0 new messages