kivy学习完全解析 004 BoxLayout 盒子布局
作者:互联网
box.kv
<BoxLayoutWidget>:
Button:
text: "Btn0"
background_color: 0, 1, 1, 1
font_size: 40
Button:
text: "Btn1"
background_color: 0, 1, 0, 1
font_size: 20
Button:
text: "Btn2"
background_color: 0, 0, 1, 1
font_size: 35
Button:
text: "Btn3"
background_color: 1, 0, 1, 1
font_size: 30
Button:
text: "Btn5"
background_color: 1, 0, 0, 1
font_size: 25
main.py
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class BoxLayoutWidget(BoxLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
class BoxApp(App):
def build(self):
return BoxLayoutWidget() #盒子布局
if __name__ == "__main__":
BoxApp().run()
标签:__,color,text,Button,kivy,004,BoxLayout,font,size 来源: https://blog.csdn.net/weixin_33595571/article/details/116334389