[Flex 4] Float left or right in layouts or containers? i have a main container, that is dynamic, 100% width, and in it there are 3 components. one should be floating to left, to right and the other will be centered. how do i do that?
+1
A:
What do you mean by float? Is there any reason a group with a HorizontalLayout won't work?
<s:group layout="{new HorizontalLayout()}" width="100%>
<container1>
<container2>
<container2>
</s:group>
www.Flextras.com
2010-08-10 00:59:02
float just like styles for html divs.<s:group layout="{new HorizontalLayout()}" width="100%> <container1/> <container2/> <container3/></s:group>the c1 must be floating to leftthe c3 must be floating to rightand c2 must be in the middle
Totty
2010-08-10 20:10:01
If memory serves me, doesn't the HTML Float allow for other "components" such as text to wrap around the floated component? IF so, nothing like that exists in Flex. You'd have to build it custom
www.Flextras.com
2010-08-10 21:21:24
+1
A:
Add your 3 components to an HGroup (spark) or an HBox (halo). If you want dividers that allow your components to be resized, you can use an HDividedBox. Hope that helps.
Edit: Here's a code example based on your comment:
<s:HGroup width="100%">
<s:Panel id="fixedPanel1" width="150"/>
<s:Panel id="variablePanel" width="100%"/>
<s:Panel id="fixedPanel2" width="150"/>
</s:HGroup>
Is this what your are looking for?
Wade Mueller
2010-08-10 01:00:37
its like this horizontally:|<-fix->|<-----var----->|<-fix->||<---------windows size-------->|fix = fixed size componentvar = variable size component
Totty
2010-08-10 20:08:20