設置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"