Why doesn't kivy work on pydroid | Sololearn: Learn to code for FREE!
+ 2

Why doesn't kivy work on pydroid

I discovered pydroid and I was really hyped about it. I used it to practice a lot offline but right now I want to try kivy but whenever I run a program, the screen just goes black. it's infuriating because their sample programs work. any help please?

29th Apr 2018, 8:08 PM
Umar Muhammad
Umar Muhammad - avatar
4 Antworten
+ 2
from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.textinput import TextInput class LoginScreen(GridLayout): def __init__(self,**kwargs): super(LoginScreen,self).__init__(**kwargs) self.cols = 2 self.add_widget(Label(text = 'username')) self.username = TextInput(multiline = False) self.add_widget(self.username) self.add_widget(Label(text='password')) self.password = TextInput(password = True, multiline = Fase) self.add_widget(self.password) class MyApp(): def build(self): return LoginScreen if __name__ == 'main': MyApp().run()
1st May 2018, 9:43 PM
Umar Muhammad
Umar Muhammad - avatar
+ 5
This will usually be due to some error in the code. If you want to share your code here, i can take a look for you
1st May 2018, 3:08 AM
Memphis Reigns
Memphis Reigns - avatar
+ 1
The screen goes black? Just wait for some time, it will work, if it doesn't there is an error in your file, it is really hard to find errors in Kivy.
16th Oct 2020, 3:58 AM
Shambhav Gautam
Use: MyApp().run() instead: if __name__ == 'main': MyApp().run() Use: class MyApp(App): instead: class MyApp():
14th May 2023, 7:18 AM
Silver Metallic Barbarian
Silver Metallic Barbarian - avatar