Kivy 如何隐藏控件?
设置opacity
属性为0即可, 如下面的例子,当Button 1
按下时整个Boxlayout
都隐藏起来
#:kivy 1.4
BoxLayout:
orientation: 'vertical'
padding: 20
spacing: 10
opacity:1
Button:
text: "Button 1"
on_release: self.parent.opacity=0
size_hint: 1, None
Button:
text: "Button 2"
size_hint: 1, 0.5
Button:
text: "Button 3"