I want to create a layout where I have something similar to a BoxLayout to give me the ability to create "rows" in my layout, and in each "row" I want to use something in the sorts of another BoxLayout to create "columns".
The columns don't need to be evenly distributed. For example, I want to create a BoxLayout with one column with a square image, and another occupying the rest of the available width.
See code and screenshot on my gist: https://gist.github.com/MichaelGradek/e5c50038b947352d9e79
I have the basic structure done in the code above, but in addition, I want the BoxLayout's height to adapt to the height of the children.
What would be the best approach to achieve this?
Thanks!
Don't use a BoxLayout, use a GridLayout with height: self.minimum_height
, and set a manual size (size_hint_y: None
and height: some_number
) for each child widget.
For me, using a GridLayout with height: self.minimum_height, and then setting a manual size (size_hint_y: None and height: some_number) for each child widget, resulted in widgets getting anchored to the bottom of root window. Couldn't really figure out why?
However, using a GridLayout with height: root.height, and then setting a manual size (size_hint_y: None and height: some_number) for each child widget resulted in correct top anchored widgets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With