i wrote my code i n a different way now and i dont have any more errors but when i run my code i only got a black kivy screen and it fits my whole laptop screen
my purpose is to have a few screens, setup a background to the screen put a few lines and a next button to go to the other screen
python file:
=====================
# File name FaceRecognition.py
import kivy
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import ScreenManager, Screen
# Define each screen
class ScreenOne(Screen):
pass
class ScreenTwo(Screen):
pass
class ScreenManagement(ScreenManager):
pass
class FaceRecognitionApp(App):
def build(self):
return ScreenManagement()
if __name__=="__main__":
FaceRecognitionApp().run()
============================
kv file :
===========================
# File name FaceRecognition.kv
#: kivy 1.9.1
ScreenManagement:
id: screen_management
ScreenOne:
ScreenTwo:
<MyButton@Button>:
color: .8,.9,0,1 # yellow color
font_size: 32 # font size
size_hint: .2,.1
<ScreenOne>:
name: "screen1"
id: screen_one
FloatLayout:
Label:
text:"Hello\n Welcome to my App\n"
font_size:40
color: 0,0,0,1
MyButton:
text: 'Next'
pos_hint:{'right':1, 'y':0}
on_press:root.manager.current="screen2"
<ScreenOne>:
name: "screen2"
id: screen_two
FloatLayout:
Label:
text:"Please insert your Name\n Please insert your Password\n"
font_size:40
color: 0,0,0,1
MyButton:
text: 'Next'
pos_hint:{'right':1, 'y':0}
on_press:root.manager.current="screen1"
==================