I have a spark Scroller which hosts a DataGroup with a vertical virtual layout. I populate the DataGroup with some item renderers (say, checkboxes). By default, checkboxes are aligned to the left and the scrollbars and everything works just fine.
The requirement that I have is to allow the users to center- or right-align the checkboxes. I'm able to do so, but the checkboxes align within the content width taken up by all checkboxes (which is the width of the widest checkbox). So, if the widest checkbox is narrower than the Scroller, I get a "blank" space to the right of the checkboxes.
Is there any way to "move" the entire viewport, if it's narrower than the Scroller, so that it aligns to the center or right of the entire Scroller? I tried a hundred different things (with viewport, content, scroller, etc.) but nothing seems to work. I haven't been able to find anything of relevance on the Web, but I might just be missing something simple...
Any help would be greatly appreciated.
Do you have a small code example? Did you play around with the DataGroup layout's horizontalAlign? The ScrollerLayout class controls the size and position of the viewport. Depending upon what you are trying to accomplish, you might need to subclass that layout.
Flex SDK Engineer