Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy refresh layout (Async Loading)

Tags:

python

kivy

I have a ListView that where each item has a AsyncImage and a Label. While the images load it shows the layout with gaps between each item.

-------

Item

-------

Item 

-------

When the first interaction happens (a scroll occurs), the layout refreshes and the gaps disappear.

-------
Item    
-------  
Item 
-------

I'd really like to have the layout refresh when an image finishes loading. How do I refresh a layout?

like image 998
leech Avatar asked Jan 10 '14 05:01

leech


1 Answers

Usually you can ask the widget to update it's canvas by calling widget.canvas.ask_update().

For a layout you could try triggering the layout of the widgets inside it by calling layout_instance.do_layout().

like image 128
qua-non Avatar answered Sep 25 '22 01:09

qua-non