Answer the question
In order to leave comments, you need to log in
How to set widget size in percentage?
Good day, let's have a widget:
Python code:
class MyWidget(Widget):
pass
class MainWidget(App):
def build(self):
main_widget = BoxLayout(orientation="horizontal")
main_widget.add_widget(MyWidget())
return main_widget
<MyWidget>:
canvas:
Color:
rgba: (0.3, 0.3, 0.3, 1)
Rectangle:
pos: self.pos
size: self.size
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question