当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Kivy subclass from Scatter dont have the same behaviour than if a construct the widget

问题描述:

class KivyVisor(Scatter):

def __init__(self,**kwargs):

super(KivyVisor, self).__init__(**kwargs)

self.add_widget(Image(source='test.jpg'))

class Test(App):

def build(self):

f = FloatLayout()

s = KivyVisor()

f.add_widget(s)

return f

if __name__ == "__main__":

Test().run()

this code show an image but i cant rotate o resize it.

but if i implement just

class Test(App):

def build(self):

f = FloatLayout()

s = Scatter()

s.add_widget(Image(source='test.jpg'))

f.add_widget(s)

return f

if __name__ == "__main__":

Test().run()

it works perfectly

Why is that?

分享给朋友:
您可能感兴趣的文章:
随机阅读: