0
저는 파이썬에서 스크립트를 가지고 있고 다른 화면에서 kivy 파일을 가지고 있습니다. 화면 1에서는 TextInput
에 몇 가지 정보를 소개하고 다음 화면 (화면 2)으로 변경할 때 화면 1의 TextInput
에서 소개하는 변수의 값을 복구하려고합니다. 기능의 값을 업데이트하는 데 문제가 있습니다. 화면의 __init__
2.화면을 바꿀 때 화면 값을 어떻게 업데이트 할 수 있습니까?
자동으로 값을 업데이트하는 가장 좋은 방법은 무엇인지 모르겠습니다.
class PantallaDos(Screen):
def __init__(self, *args):
super(PantallaDos, self).__init__(**kwargs)
softinput_mode = 'below_target'
Window.softinput_mode = softinput_mode
self.ids['pol'].text = 'verdadero'
Kivy의 kv.file
<PantallaDos>:
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 3
canvas:
Color:
rgb: 0.15,0.14,0.14
Rectangle:
pos: self.pos
size: self.size
....
SLabel:
id: pol
size_hint: None, None
size: root.width, 30
위대한 !! 고마워. – JCAguilar