0
I’m learning about using multiple screens in the kivy (using Screenmanager). However, when I run the code below I come across a black screen. No error occurs, but I could not find out which error.
Code Testapp.py:
import kivy
from kivy.app import App
from kivy.uix.screenmanager import Screen
from kivy.uix.screenmanager import ScreenManager
class Tela(ScreenManager):
pass
class Screen1(Screen):
pass
class Screen2(Screen):
pass
class Test(App):
def build(self):
return Tela()
Test().run()
Code Test.K V
<Tela>:
Screen1:
name:'screen1'
id:screen1
Screen2:
name:'screen2'
id:screen2
<Screen1>:
BoxLayout:
orientation: 'vertical'
Button:
text:'ME APERTA'
on_release: root.manager.current = 'screen2'
<Screen2>:
BoxLayout:
orientation: 'vertical'
Button:
text:'ME APERTA DE NOVO'
on_release: root.manager.current = 'screen1'
Run screen + terminal:
If the community can help me, my future thanks :D:
You need to rename the Kv file to
test.kv
lower-case.– tomasantunes
Thank you very much friend, :D
– Gustavo Ramalho