设置布局间隙

发布于 2024-09-04 11:46:14 字数 203 浏览 4 评论 0原文

我通常这样设置布局,

<s:Group>
   <s:layout>
      <s:VerticalLayout gap="10"/>
   </s:layout>
</s:Group>

但不知道如果我想使用 new VerticalLayout 如何指定间隙

I usually set the layout like this

<s:Group>
   <s:layout>
      <s:VerticalLayout gap="10"/>
   </s:layout>
</s:Group>

but not sure how to specify the gap if I want to use new VerticalLayout

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

著墨染雨君画夕 2024-09-11 11:46:14

VerticalLayout 构造函数没有任何参数,因此您无法将其作为布局属性的一部分在 MXML 中内嵌执行。创建布局后,您必须在布局上设置间隙属性。也许在creationComplete处理程序中,执行如下操作:

groupID.layout.gap = 10;

您甚至可以内联执行此操作:

<s:Group layout="{new VerticalLayout()}" id="groupID" creationComplete="{groupID.layout.gap = 10}"></s:Group>

The VerticalLayout constructor does not have any parameters, so you won't be able to do this in-line in MXML as part of the layout property. You'll have to set the gap property on the layout after creating it. Perhaps in a creationComplete handler, do something like this:

groupID.layout.gap = 10;

You can probably even do this in-line:

<s:Group layout="{new VerticalLayout()}" id="groupID" creationComplete="{groupID.layout.gap = 10}"></s:Group>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文