Решение состоит в том, чтобы установить AnchorLayout
в третьем столбце и внутри этого макета кнопку:
<AppCore>
GridLayout:
cols: 3
size: root.width * 0.8, root.height * 0.8
row_default_height: 30
row_force_default: True
center: root.width / 2, root.height / 2
Label:
text: 'hello world'
TextInput:
id: text_field
multiline: False
AnchorLayout:
anchor_x: 'right'
Button:
id: f_but
width: 40
size_hint_x: None
Для лучшей наглядности давайте разместим цвета фона:
<AppCore>
GridLayout:
cols: 3
size: root.width * 0.8, root.height * 0.8
row_default_height: 30
row_force_default: True
center: root.width / 2, root.height / 2
Label:
text: 'hello world'
canvas.before:
Color:
rgba: 1, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
TextInput:
id: text_field
multiline: False
AnchorLayout:
anchor_x: 'right'
canvas.before:
Color:
rgba: 0, 0, 1, 1
Rectangle:
pos: self.pos
size: self.size
Button:
id: f_but
width: 40
size_hint_x: None