I try to resize a button at the half of the width of the BoxLayout, but i don't know why that don't work on the 'x' axis.
Here my .kv file:
MainWidget:
<MainWidget>:
BoxLayout:
canvas.before:
Color:
rgba: (1,0,0,1)
Rectangle:
pos: self.pos
size: self.size
Button:
text: "+"
color: 0,0,0
size_hint: .5, .5 << HERE
pos_hint: {'center_x': .5,'center_y': .5}
canvas.before:
Color:
rgba: (1,0,1,1)
Rectangle:
size: self.size
pos: self.pos
and what i got:
How can I resolve tis issue?

To have your button half the width/height of the
BoxLayoutyou can set thesize_hinttoNone, None, then set thewidthandheightwith the parent settings divided by 2. See example below:I also changed the
BoxLayoutto aFloatLayoutso that thepos_hintcan work properly.Hope this helps!