【发布时间】:2020-08-03 21:55:19
【问题描述】:
temp_label = Label(text= str(temp) + 'C', pos=(-300, -50))
temp_label.bind(on_touch_down = self.disappear)
self.add_widget(temp_label)
def disappear(self, label_instance, label_choice):
self.remove_widget(self.temp_label)
我想使用 'on_touch_down' 删除标签,但每次我这样做时都会收到此错误
AttributeError: 'UK_Weather' object has no attribute 'temp_label'
以上只是sn-p的代码,如果可能的话可以用python语言回答
【问题讨论】: