Flex (4) Repeater control overflows contrainer
I have a repeater control in an AIR application, that gets data dynamically. The repeater is inside a panel:
<s:Panel top="50" bottom="10" left="10" right="10">
<mx:VBox>
<mx:Repeater id="FeedItemsRptr" dataProvider="{Story_Collection}" height="300">
<s:Label text="{FeedItemsRptr.currentItem.storyTitle}" />
<s:RichText text="{FeedItemsRptr.currentItem.storyDesc}" />
<mx:HRule width="100%"/>
</mx:Repeater>
</mx:VBox>
</s:Panel>
However, when the data is bound to the control, the repeater text 开发者_开发技巧flows out of the panel container instead of getting scrollbars.
I have tried to encapsulate the repeater inside an to the same effect, while is even more unpredictable.
Any idea on how to tame the repeater?
http://i.stack.imgur.com/WFspk.png
you can find more on what I wanted to do by going to : http://aphatak.blogspot.com/2010/11/and-take-that-too-times-of-india.html
I have kept some screenshots, flash builder source and compiled bin there; thanks for your help!
A solution that seems to be working is wrapping up the VBox in a spark:Scroller component like below:
<s:Panel width="100%" height="100%" top="50" bottom="10"
left="10" right="10" title="{FeedItemsRptrCont.height}">
<s:Scroller width="100%" height="100%">
<s:Group width="100%" height="100%">
<mx:VBox id="FeedItemsRptrCont" width="100%" height="100%">
<mx:Repeater id="FeedItemsRptr" width="100%" height="100%" dataProvider="{Story_Collection}">
<s:Label text="{FeedItemsRptr.currentItem.storyTitle}" />
<s:RichText text="{FeedItemsRptr.currentItem.storyDesc}" />
<mx:HRule width="100%" />
</mx:Repeater>
</mx:VBox>
</s:Group>
</s:Scroller>
</s:Panel>
However, what you want to be doing seem to be something that a spark:List would do better than a repeater.
精彩评论