What is the difference between VGroup container and Group container with nested VerticalLayout in fle4?

StackOverflow https://stackoverflow.com/questions/21672411

  •  09-10-2022
  •  | 
  •  

Domanda

I am a beginner for flex. Now i am trying samples using the layout.

See the following scenario,

<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>

Is it having any differences? If it's having, please share it with me. Otherwise tell me which one is better or which one is correct?

Thanks in advance.

È stato utile?

Soluzione

The two are equivalent, mostly...

In general if I know the group layout orientation I'll use VGroup/HGroup rather than Group and layout, but that's just my preference, I don't think there's a significant performance difference.

I have places where I need to change orientation, so I'll use Group and change the layout based on the orientation state. VGroup/HGroup won't let you change the layout associated with them.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top