簡體   English   中英

Python Kivy GridLayout,定位

[英]Python Kivy GridLayout, positioning

在這里看圖片

大家好,我是 kivy 的新手,無法獲得預期的結果。

:標題:“測試”網格布局:行:2列:2間距:20 canvas.before:顏色:rgba:0、1、0、1矩形大小:self.size pos:self.pos

    GridLayout:
        rows:1
        cols:2
        size: 200, 200
        size_hint: None, None

        GridLayout:
            rows: 1
            cols: 2

            Button:
                text: "test0-1"
                size: 100, 100
                size_hint: None, None
            Button:
                text: "test0-2"
                size: 100, 100
                size_hint: None, None
        Button:
            text: "test01-1"
            size: 200, 100
            size_hint: None, None

    Button:
        text: "test1"
        size_hint: None, None
        size: 500, 500

:標題:“測試” GridLayout:行:1 列:2 #spacing:20 canvas.before:顏色:rgba:0、1、0、1 矩形大小:self.size 位置:self.pos

    GridLayout:
        rows:2
        cols:1
        size: 200, root.size[1]
        size_hint: None, None
        #pos_hint:{"x":1,"y":1}

        GridLayout:
            rows: 1
            cols: 2
            Button:
                text: "test0-1"
                size: 100, 100
                size_hint: None, None
            Button:
                text: "test0-2"
                size: 100, 100
                size_hint: None, None

        Button:
            text: "test01-1"
            size: 200, root.size[1] - 100
            size_hint: None, None


    Button:
        text: "test1"
        #size_hint: .7
        #size: 500, 500[enter image description here][1]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM