I have a spark List control. I want it to stretch each item in the list so the entire list fills up 100% of the width. How do I do this? I tried setting the List's width to 100%, the HorizontalLayout variableColumnWidth="true" and the itemRenderer's width to 100% but it doesn't work. Each item remains at the minimum width needed to show the content.
I have a spark List control. I want to center each itemRenderer within the allocated list space. Each item is in a VBox (I've also tried VGroup) with horizontalAlign="center" and verticalAlign="middle". It doesn't work. Each item appears at the top left of the list cell.
1) Have you tried horizontalAlign="justify|contentJustify" ?
2) Have you actually told your container to take up ALL the width and height of it's parent? IE pecent width and height.
I gave up and switched back to mx containers/controls. No problems there. Setting everything to 100% does what I expect.
Still would like to know how to center something within a container in Spark though.
As far as a spark Group it's either horizontalCenter="0" for BasicLayout or ;
<s:Group> <s:layout> <s:VerticalLayout horizontalAlign="center"/> </s:layout> </s:Group>
You have to make sure the group is extending to the bounds of it's parent.
<s:Group top="0" bottom="0" left="0" right="0">