how to switch screens in kivy

Solutions on MaxInterview for how to switch screens in kivy by the best coders in the world

showing results for - "how to switch screens in kivy"
Malena
13 Feb 2019
1from kivy.uix.screenmanager import ScreenManager, Screen
2
3# Create the manager
4sm = ScreenManager()
5
6# Add few screens
7for i in range(4):
8    screen = Screen(name='Title %d' % i)
9    sm.add_widget(screen)
10
11# By default, the first screen added into the ScreenManager will be
12# displayed. You can then change to another screen.
13
14# Let's display the screen named 'Title 2'
15# A transition will automatically be used.
16sm.current = 'Title 2'
17