私はKivyが初めてで、適切なレイアウトを数日間試みましたが、結果が得られないようです。写真のボタン '2' と '3' をボタン '1' と '4' のように角に置いておきたいです。私は何をすべきか?
http://i.stack.imgur.com/Y6Rjo.png
ここに私のコードがありますが、必要に応じて機能しません:
# Main
BoxLayout:
size_hint: 1, .85
# Outer
canvas:
Color:
rgba: 1, 1, 1, .3
Rectangle:
pos: self.pos
size: self.size
# Inner
BoxLayout:
AnchorLayout:
canvas:
Color:
rgba: 1, 1, 1, .6
Rectangle:
pos: self.center_x / 2, self.center_y / 2
size: self.width / 2, self.height / 2
BoxLayout:
size_hint: .5, .5
AnchorLayout:
anchor_x: 'left'
anchor_y: 'top'
Button:
size_hint: None, None
text: '1'
AnchorLayout:
anchor_x: 'right'
anchor_y: 'top'
Button:
size_hint: None, None
text: '2'
AnchorLayout:
anchor_x: 'left'
anchor_y: 'bottom'
Button:
size_hint: None, None
text: '3'
AnchorLayout:
anchor_x: 'right'
anchor_y: 'bottom'
Button:
size_hint: None, None
text: '4'