层级 (查看完整内容)

构造函数

属性

_items: ItemInfo[]
_lineItemCnt: number = 0
_lineItemCnt2: number
_loop: boolean
_owner: GList
_realNumItems: number
_virtual: boolean

访问器

  • get columns(): number
  • 返回 number

    This option is only effective for FlowX layout type. If set to a value greater than 0, a new row will only be started when the number of items in each row reaches the specified value.

    这个选项只对FlowX布局类型布局有效。如果设置了大于0的值,则每行的数量到达设定的值才会开启新的一行。

  • set columns(value): void
  • 参数

    • value: number

    返回 void

    This option is only effective for FlowX layout type. If set to a value greater than 0, a new row will only be started when the number of items in each row reaches the specified value.

    这个选项只对FlowX布局类型布局有效。如果设置了大于0的值,则每行的数量到达设定的值才会开启新的一行。

  • get foldInvisibles(): boolean
  • 返回 boolean

    If set to true, when an item is not visible (visible=false), it will not reserve space for it during layout, meaning the layout will ignore this item; if unchecked, it will reserve space for this item, resulting in a blank placeholder.

    如果设置为true,当某个item不可见时(visible=false),布局时不会为他留位置,也就是排版时会忽略这个item;如果不勾选,则会为这个item保留位置,显示效果就是一个空白的占位。

  • set foldInvisibles(value): void
  • 参数

    • value: boolean

    返回 void

    If set to true, when an item is not visible (visible=false), it will not reserve space for it during layout, meaning the layout will ignore this item; if unchecked, it will reserve space for this item, resulting in a blank placeholder.

    如果设置为true,当某个item不可见时(visible=false),布局时不会为他留位置,也就是排版时会忽略这个item;如果不勾选,则会为这个item保留位置,显示效果就是一个空白的占位。

  • get minChildSize(): number
  • 返回 number

    The minimum size for child nodes. When automatically adjusting the size of child nodes based on layout parameters, it will not be smaller than this value. For example, if set to 30 and a node requires a width of 10 during layout, the final width of the node will be set to 30.

    当根据布局参数自动改变子节点的大小时,不会小于这里设置的值。例如,如果这里设置了30,并且一个节点在排列时要求宽度为10,则节点最后的宽度会被设置为30。

  • set minChildSize(value): void
  • 参数

    • value: number

    返回 void

    The minimum size for child nodes. When automatically adjusting the size of child nodes based on layout parameters, it will not be smaller than this value. For example, if set to 30 and a node requires a width of 10 during layout, the final width of the node will be set to 30.

    当根据布局参数自动改变子节点的大小时,不会小于这里设置的值。例如,如果这里设置了30,并且一个节点在排列时要求宽度为10,则节点最后的宽度会被设置为30。

  • get padding(): number[]
  • 返回 number[]

    设定容器内部四个方向的留空。四个元素依次为[上,右,下,左]。

    Set the padding for the four directions inside the container. The four elements are in the order of [UP, RIGHT, DOWN, LEFT].

  • set padding(value): void
  • 参数

    • value: number[]

    返回 void

    设定容器内部四个方向的留空。四个元素依次为[上,右,下,左]。

    Set the padding for the four directions inside the container. The four elements are in the order of [UP, RIGHT, DOWN, LEFT].

  • get rows(): number
  • 返回 number

    This option is only effective for FlowY layout type. If set to a value greater than 0, a new column will only be started when the number of items in each column reaches the specified value.

    这个选项只对FlowY布局类型布局有效。如果设置了大于0的值,则每列的数量到达设定的值才会开启新的一列。

  • set rows(value): void
  • 参数

    • value: number

    返回 void

    This option is only effective for FlowY layout type. If set to a value greater than 0, a new column will only be started when the number of items in each column reaches the specified value.

    这个选项只对FlowY布局类型布局有效。如果设置了大于0的值,则每列的数量到达设定的值才会开启新的一列。

方法

  • 参数

    • 可选childCount: number

      The number of children to fit in the container.

    • 可选minSize: number

      The minimum size for the container.

    返回 void

    Resize the container to fit specified child count and minimum size.

    调整容器大小以适应指定的子节点数量和最小尺寸。