UI组件
layout
column & row
💡

由于是 view 的子类,因此支持 view 的所有属性。

column 是一种竖向布局, row 是一种横向布局,他们底层都使用了 LinearLayout (opens in a new tab) 实现,因此具有相同的props属性。

{
    type: "column",
    props: {
          align: $align.center,
    },
    layout: {
        width: "match_parent",
        height: "match_parent",
    },
    views: [
        {
            type: "text",
            props: {
                text: "Hello, OneScript!",
            }
        }
    ]
}

props

属性类型描述
align$align指定子view在布局中的对其方式,顶部$align.top、底部$align.bottom、左侧$align.start、右侧$align.end、居中$align.center