+ 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?
4 ответов
+ 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()
+ 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
+ 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.
0
Use:
MyApp().run()
instead:
if __name__ == 'main':
MyApp().run()
Use:
class MyApp(App):
instead:
class MyApp():