kivy __init__() got an unexpected keyword argument '__no_builder' Kivy

from kivy.lang.builder import Builder
from kivy.app import App, runTouchApp
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.scrollview import ScrollView
from kivy.uix.stacklayout import StackLayout

Builder.load_string('''
<Row>
    orientation: 'vertical'
    size_hint_y: None
    height: '40dp'
    Button:
        text: 'row'

<Box>
    orientation: 'lr-tb'
    spacing: '10dp'
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:
    Row:

<Main>
    ScrollView:
        Box:

''')

class Main(Screen):
    pass

class Box(StackLayout):
    pass

class Row(BoxLayout):
    def __init__(self, *args, **kwargs):
        super(Row, self).__init__(*args, **kwargs)
        print('row init')

class MyApp(App):
    def build(self):
        return Main()

runTouchApp(Main())
# if __name__ == '__main__':
#     MyApp().run()

  

 

def __init__(self, *args, **kwargs):
        super(Row, self).__init__(*args, **kwargs)
        print('row init')

posted @ 2019-02-11 19:53  CrossPython  阅读(548)  评论(0编辑  收藏  举报