【发布时间】:2020-03-15 12:38:05
【问题描述】:
我想像这样将我的按钮 4 个按钮并排放置。https://i.stack.imgur.com/fGIFP.png 但我有这样的按钮https://i.stack.imgur.com/yts0z.png 如何更改它。这是我的代码。你好,现在我添加了更多代码,如果你想将它与其他盒子结合起来怎么办。 现在我有 2 个组合箱。我有问题,他们每个人都会得到 4 个选项
ScrollView:
GridLayout:
rows: 3
id :topic_grid
size_hint_y: None
spacing: 40,70
height: self.minimum_height
row_default_height: "3500dp"
row_force_default: True
BoxLayout:
orientation: "vertical"
# question 1
Label:
color: 1,0,0,1
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Which team won the most titles in the SuperLig"
font_size: 30
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Galatasary"
size: 30,30
border: (2, 2, 2, 2)
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Fenerbahce"
size: 30,30
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Trabzonspor"
size: 30,30
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Besiktas"
size: 30,30
Label:
color: 1,0,0,1
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Which team won the 1994 football world cup"
font_size: 30
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Republic of Ireland"
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Brazil"
size: 30,30
on_release:
self.background_color = 250,255,0,0.3
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "Germany"
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "USA"
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
【问题讨论】:
标签: python button formatting kivy kivy-language