Kivy Course #8 – Multiple Screens in Kivy With ScreenManager

In this part of course, you will find how to make applications for desktop or mobile consisting of two or more different screens. There can be menus, tutorials, question-answer sessions or any other requirements that can be solved with multiple screens. We utilize ScreenManager shipped with kivy for this purpose. The code is:


from import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen

        text: "İleri"
        on_release: root.manager.current =
        text: "Geri"
        on_release: root.manager.current = root.manager.previous()
class GirisEkrani(Screen):

class KontrolEkrani(Screen):

class ekranApp(App):
    def build(self):
        root = ScreenManager()
        root.add_widget(GirisEkrani(name = "giris_ekrani"))
        root.add_widget(KontrolEkrani(name = "kontrol_ekrani"))
        return root

if __name__ == "__main__":

Note that in this example only one file is used for both Kivy and Python file. You can use Builder.load_string to apply a Kivy design which is in a string to your Python code.


comments powered by Disqus