0
私はCardTransitionを使用する複数の画面で簡単なアプリケーションを作成しようとしていますが、実行しようとするとエラーが発生します。私は別の移行でそれを試して、それは正常に動作するため、アプリケーション自体が動作することを知っている。私はKivy 1.9.1でPython 3.4.4を使用しています。CardTransitionがKivy 1.9.1で動作していない
import kivy
kivy.require("1.9.1")
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, SwapTransition, CardTransition
KivyFile = Builder.load_string("""
<Screen1>:
name: "Screen1"
BoxLayout:
orientation: "vertical"
padding: 40
spacing: 20
Label:
text: "This is screen 1"
Button:
text: "Next Screen"
on_release: app.root.current = "Screen2"
<Screen2>:
name: "Screen2"
BoxLayout:
orientation: "vertical"
padding: 40
spacing: 20
Label:
text: "This is screen 2"
Button:
text: "Next Screen"
on_release: app.root.current = "Screen3"
<Screen3>:
name: "Screen3"
BoxLayout:
orientation: "vertical"
padding: 40
spacing: 20
Label:
text: "This is screen 3"
Button:
text: "Next Screen"
on_release: app.root.current = "Screen1"
""")
class Screen1(Screen):
pass
class Screen2(Screen):
pass
class Screen3(Screen):
pass
sm = ScreenManager(transition=CardTransition())
sm.add_widget(Screen1(name = "Screen1"))
sm.add_widget(Screen2(name = "Screen2"))
sm.add_widget(Screen3(name = "Screen3"))
class MyApp(App):
def build(self):
return sm
if __name__ == "__main__":
MyApp().run()
ここで私が手にエラーがあります:
Traceback (most recent call last):
File "C:/Users/Markus/Desktop/Kivy/TestTransitions.py", line 9, in <module>
from kivy.uix.screenmanager import ScreenManager, Screen, SwapTransition, CardTransition
ImportError: cannot import name 'CardTransition'