【问题标题】:What is the difference between VGroup container and Group container with nested VerticalLayout in fle4?VGroup 容器和 fle4 中嵌套 VerticalLayout 的 Group 容器有什么区别?
【发布时间】:2014-02-10 08:43:17
【问题描述】:

我是 flex 的初学者。现在我正在尝试使用布局的示例。

看下面的场景,

<s:VGroup horizontalAlign="center">
     <s:Label text="VGroup Container"/>
     <s:Button label="One"/>
     <s:Button label="Two"/>
     <s:Button label="Three"/>
</s:VGroup>

<s:Group>
     <s:layout>
           <s:VerticalLayout horizontalAlign="center"/>
     </s:layout>
     <s:Label text="Group with VerticalLayout"/>
     <s:Button label="One"/>
     <s:Button label="Two"/>
     <s:Button label="Three"/>
</s:Group>

有什么不同吗?如果有,请与我分享。否则告诉我哪个更好或哪个是正确的?

提前致谢。

【问题讨论】:

    标签: apache-flex flex4


    【解决方案1】:

    两者是等价的,大多...

    一般来说,如果我知道组布局方向,我会使用 VGroup/HGroup 而不是 Group 和布局,但这只是我的偏好,我认为不会有显着的性能差异。

    我有需要更改方向的地方,所以我将使用 Group 并根据方向状态更改布局。 VGroup/HGroup 不会让您更改与它们关联的布局。

    【讨论】:

    • 谢谢比尔·特纳。现在我还有一个问题。我们不能在 VGroup/HGroup 中进行方向更改,或者我们不会?对不起这个冷酷的问题。但我只想知道。谢谢。
    • 无法更改 - VGroup 和 HGroup 中的布局设置器被覆盖以防止更改。
    • 非常感谢比尔·特纳。
    猜你喜欢
    • 2015-03-18
    • 2019-07-30
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 1970-01-01
    • 2016-01-23
    相关资源
    最近更新 更多