Ich kann .Text nicht mit ID in BoxLayout von .KV -Datei auf VSCODE auf die Beschriftung einstellen.Python

Python-Programme
Anonymous
 Ich kann .Text nicht mit ID in BoxLayout von .KV -Datei auf VSCODE auf die Beschriftung einstellen.

Post by Anonymous »

Ich entwickle eine Android -App, die den Zeitplan zeigt. Ich habe einige Tutorials gefolgt und schließlich diese Code -Teile gemacht: < /p>
ui.py
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout

from kivy.lang import Builder

kivy.require('1.9.0')

class schedule(BoxLayout):
def __init__(self):
super(schedule, self).__init__()
def showSchedule(self):
self.scheduleText.text = str("12345")

class appFrontEnd(App) :
def build(self):
return schedule()

Builder.load_file("frontend.kv")
frontEnd = appFrontEnd()
frontEnd.run()
< /code>
Frontend.kv
:
scheduleText: scheduleText
BoxLayout:
orientation:'vertical'

Label:
text: "Schedule"
font_size: 64
color: 0.92, 0.45, 0
Label:
id: scheduleText
text: "No"
font_size: 21
Button:
text: "Update schedule"
font_size: 32
size: 100, 50
< /code>
Code wird ohne Fehler ausgeführt, und ich kann die Schaltfläche sehen und interagieren, aber Text mit ID -Scheduletext ist immer noch "Nein".>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post