01.26
So Flex 4 is in Beta and we should accept that quirks will occure but this one is driving me a little loopy to the point of even cursing my friend Flex.
The day started like any other until I noticed this unnecessary gap between each of my vertically stacked list’s using the TileLayout, yes it is very possible to take the approach of creating my own layout (that’s why the new Flex 4 Framework is so good) though I opted for looking for a property that might remove this, disaster! disaster! nothing works so next step is to extend tile list and look for this weird occurance.
Best I could do (though not completly happy with) is override the measure() and change the explicit height of the component as it seems explicit height is forcing the constant height.
Hopefully this helps somebody out or even better can direct me to a better fix
package com.skysongs.mediaplayer.view.layouts { import mx.core.ILayoutElement; import spark.components.supportClasses.GroupBase; import spark.layouts.TileLayout; public class MusicTileLayout extends TileLayout { /** * Constructor * */ public function MusicTileLayout() { super( ); } /** * Measure * @inheritDoc */ override public function measure():void { var layoutTarget:GroupBase = target; layoutTarget.explicitHeight = Math.ceil(rowCount * (rowHeight + verticalGap) - verticalGap); super.measure( ); } } }
Please hurry up Adobe, I want the final release now…
ADDED!!! in case the measure property is not called when resizing is done you can override updateDisplayList and call the measure() function.
/** * Update Display List * @inheritDoc * */ override public function updateDisplayList(width:Number, height:Number) : void { super.updateDisplayList( width, height ); /* Force remeasure */ measure(); }
Again I would not recommend this as a final solution (will most likely be fixed in an upcoming version of the SDK)
ps.. Logged an issue with Adobe (http://forums.adobe.com/thread/565055)