列的红色vid布局

时间:2018-06-14 16:34:20

标签: red

如何很好地对齐列:

可以做的事情:

    view layout [

        title "How to align ?"

        panel [
            text "" text "col1" text "col2"
        ]

        return

        panel [
            text "very short" field "" field ""
        ]
        return
        panel [
            text "short" field "" field ""
        ]

    ]

enter image description here

事情出错:

    view layout [

        title "How to align ?"

        panel [
            text "" text "col1" text "col2"
        ]

        return

        panel [
            text "very short" field "" field ""
        ]
        return
        panel [
            text "short" field "" field ""
        ]
        return
        panel [
            text "but if very very long" field "" field ""
        ]

    ]

enter image description here

后续问题:如何缩小行之间的空间?

1 个答案:

答案 0 :(得分:1)

您需要将面板做成列而不是行,然后给它们指定可以满足您需要的特定宽度。

view layout  [

    title "How to align ?"

    panel 120x300 [
        text "" return
        text "very short" return
        text "short" return
        text "but if very very long" return

    ]

    panel 120x300 [
        text "col1" return 
        field return
        field return
        field return
    ]

    panel 120x300 [
        text "col2" return 
        field return
        field return
        field return
    ]
]

enter image description here