Automatically sizing a Widget to fit the children

15 views
Skip to first unread message

Lawrence Moore

unread,
Jul 30, 2015, 11:59:27 AM7/30/15
to Kivy users support
I'm trying to create a bubble widget which has various numbers of options depending on the circumstances in which it was clicked, but I'm having trouble sizing it properly.  Is there an easy way to automatically set the size to fit the children?  Thanks!

Alexander Taylor

unread,
Jul 30, 2015, 1:54:14 PM7/30/15
to Kivy users support, lsmoo...@gmail.com, lsmoo...@gmail.com
Usually it's best to use a GridLayout for the automatic sizing, with 'height: minimum_height' and 'size_hint_y: None' in its kv rule (or the equivalent with width for a horizontal version).

I don't remember how bubble works, but I guess either it will automatically resize to fit the gridlayout, or you can do that manually too.
Reply all
Reply to author
Forward
0 new messages