Kivy - Removing widget by id
问题 I have the following code: from kivy.app import App from kivy.uix.floatlayout import FloatLayout class GUI(FloatLayout): def remove(self): self.remove_widget(self.ids.test) class GUIApp(App): def build(self): return GUI() if __name__ == '__main__': GUIApp().run() And the corresponding kv file: #:kivy 1.9.1 <GUI>: BoxLayout: Button: id: test text: 'Test' on_press: root.remove() The button should be removed when clicked. However, this does not happen. If I remove the BoxLayout in the kv file,