我正在设计一个应用程序的主菜单,但是我似乎无法弄清楚如何在Kivy中为BoxLayout设置边框,有没有办法可以做到这一点?如果可以,有人可以帮忙吗?我已经尝试使用canvas.before并给矩形加上边框,但这并不起作用。
<MainMenuWindow>:
id: Main_Menu_window ## setting the id to Login_window
BoxLayout: ## whole screen
orientation: 'horizontal'
BoxLayout: ## left hand side 1/3
canvas.before:
Color:
rgba: 0, 0, 0, 1
Line:
width:
rectangle: self.x, self.y, self.width, self.height
orientation: 'vertical' ## setting orientation of the screen to vertical
size_hint_x: 1/3 ## setting size of box to 1/3 of the screen
canvas.before:
Color: ## just for debugging reasons
rgba: (255/255,255/255,255/255, 1) ## setting colour
Rectangle:
size: self.size ## setting size to the size of the box layout
pos: self.pos ## setting position to the position of the box layout
rgba
更改为1,0,0,1
会发生什么? - John Anderson