Python Forum
Help with code Kivy/Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with code Kivy/Python
#1
Hello everyone, I need a help, I do not understand why when I run the following code the screen appears only black. Can someone give me a hand?

I'm starting my first mobile software, I'm happy if you can help, thank you :D

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
 
class Principal(App):
 
         def Build(self):
                  self.img1 = Image(source= "images/Logo.jpg",size_hint= (.5, .3),pos_hint={"center_x":.5, "center_y":.9}),
                  self.img2 = Image(source= "images/super.png",size_hint= (.99, .3), pos_hint={"center_x":.5, "center_y":.65}),
                  lb1 = Label(text="Usuário: ",font_size= '15sp',size_hint= (None,None),pos_hint= {"center_x":.40, "center_y":.43},bold= True),
                  lb2 = Label(text="Senha: ",size_hint= (None,None),font_size= "15sp",pos_hint={"center_x":.40, "center_y":.36},bold= True),
                  lb3 = Label(text="Cadatre-se!",size_hint= (None, None),font_size= "8sp",pos_hint= {"center_x":.5, "center_y":.3},bold= True),
                  lb4 = Label(text="Esqueceu sua senha?",size_hint= (None, None),font_size= "8sp",pos_hint= {"center_x":.5, "center_y":.32},bold= True)
 
                  layoutVideo = FloatLayout()
 
                  layoutVideo.add_widget(self.img1)
                  layoutVideo.add_widget(self.img2)
                  layoutVideo.add_widget(lb1)
                  layoutVideo.add_widget(lb2)
                  layoutVideo.add_widget(lb3)
                  layoutVideo.add_widget(lb4)
 
                  return layoutVideo
 
if __name__ == "__main__":
Principal().run()
Reply


Messages In This Thread
Help with code Kivy/Python - by Couzer - Oct-04-2018, 03:19 PM
RE: Help with code Kivy/Python - by joe_momma - Nov-13-2018, 02:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Kivy] 'Design' had no attribute 'add' Error in Python and Kivy yahucoder 2 3,151 May-20-2019, 02:32 PM
Last Post: yahucoder
  Python Kivy Emerogork 1 3,062 Mar-19-2018, 09:30 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020