I think list does a bit more thinking.  I think it computes a typicalItem and 
uses that as the default size.  One of the issues with Image-based renderers is 
that they have no size until the image loads.  If you know the size upfront, 
set that on the renderer.


On 3/30/10 6:29 AM, "Dan Vega" <[email protected]> wrote:






Take the following example. On the left you have a list that loads data from 
another file. The data is a basically a set of typed objects that have a src 
attribute that points to an image. Don't worry to much about that, just know 
that we are getting a list of images. The list on the left shows an initial 
list with some scrollbars and about 5 images. The list looks like it can only 
scroll 1 or 2 more images but in fact there are about 20 images. As you start 
scrolling the list figures out that there are more and adjusts the scroll bars. 
It keeps doing this until we reach the last images and finally the scroll bars 
work as expected.

What I don't understand is the data group next to it works exactly how I expect 
the list to work. I thought the list was basically using the data group in the 
end anyways? What am I missing / doing wrong? If you need the full example I 
can email it to you, just ping me.

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark <http://ns.adobe.com/flex/spark> "
xmlns:mx="library://ns.adobe.com/flex/mx <http://ns.adobe.com/flex/mx> "
initialize="GalleryService.loadData()" >
<s:layout>
<s:HorizontalLayout paddingTop="20" paddingRight="20" paddingBottom="20" 
paddingLeft="20"/>
</s:layout>
<s:List
height="100%"
dataProvider="{GalleryService.results}"
itemRenderer="GalleryImageRenderer"
dragEnabled="true"
>
<s:layout>
<s:VerticalLayout horizontalAlign="justify"/>
</s:layout>
</s:List>
<s:Scroller height="100%">
<s:DataGroup dataProvider="{GalleryService.results}" 
itemRenderer="GalleryImageRenderer">
<s:layout>
<s:VerticalLayout horizontalAlign="justify"/>
</s:layout>
</s:DataGroup>
</s:Scroller>
-->
</s:Application>


Thank You
Dan Vega
[email protected]
http://www.danvega.org/





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to