3

I am testing kivy and I want to create a BoxLayout so to stack some buttons. My problem is that the children that are added to the layout follow a bottom-top logic while I want the opposite. Do you know how can I reverse the order? Thanks!

4

2 回答 2

8

有两种方法可以做到这一点。以相反的顺序将您的按钮传递给 add_widget() 方法,或者如果您使用 Kivy >= 1.0.5,请将索引传递给 add_widget

box = BoxLayout(...)
btn = Button(...)
box.add_widget(btn, len(box.children))
于 2012-05-05T18:42:59.450 回答
1

有一个棘手的方法可以做到这一点。

使用网格布局并将 cols 设置为 1

于 2014-03-31T07:33:38.250 回答