小编Tyl*_*ner的帖子

有没有办法在 kivy BoxLayouts 周围放置边框?

我正在为我正在创建的应用程序设计一个主菜单,但我似乎无法弄清楚如何在 kivy 中为盒子布局设置边框,有没有办法做到这一点?如果是的话有人可以帮忙。我尝试使用 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 …
Run Code Online (Sandbox Code Playgroud)

user-interface kivy

5
推荐指数
1
解决办法
3864
查看次数

标签 统计

kivy ×1

user-interface ×1