Kivy Gridlayout error: have no cols or rows set, layout is not triggered
问题 I'm trying to create a basic Kivy app that has 4 labels in a GridLayout. Here's my Python code: from kivy.lang import Builder from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label class MyLayout(GridLayout): def __init__(self, **kwargs): Builder.load_file("mylayout.kv") super(MyLayout, self).__init__(**kwargs) class MyApp(App): def build(self): return MyLayout() if __name__ == '__main__': MyApp().run() Here is my mylayout.kv file: <MyLayout>: