1
即時通訊仍然是kivy的先行者,當我在Windows上啓動我的kivy應用程序時,我得到一個黑winodw,窗口適合整個筆記本電腦屏幕。我該如何解決這個問題,以及如何調整窗口大小?在windows上獲得黑屏時,我的kivy應用程序
我的Python代碼
# File name FaceRecognition.py
import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.lang import Builder
# Define each screen
class ScreenOne(Screen):
pass
class ScreenTwo(Screen):
pass
class ScreenManagement(ScreenManager):
pass
Builder.load_file("facerecognition.kv")
class FaceRecognitionApp(App):
def build(self):
return ScreenManagement()
if __name__=="__main__":
FaceRecognitionApp().run()
我千伏文件
# File name FaceRecognition.kv
#: kivy 1.9.1
ScreenManagement:
id: screen_management
ScreenOne:
ScreenTwo:
<[email protected]>:
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"