Open khoamoc opened 9 years ago
The problem is that the images aren't loaded yet when the WaterfallLayout needs to calculate the width of a column. It can only use the width of the label, which may not be the same size as the width of an image. It sets the width property of each item renderer to whatever it calculates, and after that point, the item renderers cannot resize.
You could simply set the width of the item renderer to a fixed value:
renderer.width = 270; // just some arbitrary value for this example
Alternatively, you could calculate a value based on the stage width:
renderer.width = stage.stageWidth / 4;
Another option is to provide a typicalItem to the List.
var quad:Quad = new Quad(270, 100);
_list.typicalItem = { text: "xyz", measureThumb: quad };
Then, you can set the iconField on the item renderer. The item renderer is smart enough to figure out if it needs to use iconField or iconSourceField based on what properties are set on the item.
renderer.iconSourceField = "thumb";
renderer.iconField = "measureThumb";
Hi, there's some bugs with Waterfall layout when using DefaultListItemRenderer, all other layouts work ok,
in the code below :