0
問題是,當按下按鈕時我可以觸發事件,但按鈕釋放不起作用;這裏是我的.kv代碼:按鈕釋放事件在Kivy中不起作用
Button:
id: my_custom_label
text: 'SOS'
height: "95dp"
width: "160dp"
on_press: app.sendprogress() # this is working
on_release : app.sendhelp() # this is not working
size_hint: None, None
pos_hint: {'center_x': .1, 'center_y': .1}
canvas.before:
PushMatrix
Rotate:
angle: 0
origin: self.center
canvas.after:
PopMatrix
我看到的錯誤是這樣的:
32: on_press: app.sendprogress()
>> 33: on_release : app.sendhelp()
34: size_hint: None, None
35: pos_hint: {'center_x': .1, 'center_y': .1}
...
Invalid property name
我們可以看到'sendhelp()'方法嗎? – IanAuld