views:

313

answers:

3
<mx:Tile width="100%" height="20">
    <mx:Button label="btn"/>
    <mx:Button label="btn"/>
    <mx:Button label="btn"/>
    <mx:Button label="btn"/>
    <mx:Button label="btn"/>
    <mx:Button label="btn"/>
</mx:Tile>

The above Tile has a height of 20. When I add 50 new buttons to it, a vertical scrollbar is added. How can I make it not show the scrollbar but change it's height dynamically so that all the added items are always shown. Kinda like an "expanding" tile.

A: 

According to the Flex Documentation, the height of the Tile-container is set dynamically:

Default height of the Tile container is equal to (tile cell default height) x (rounded square root of the number of children), plus any gaps between children and any padding. Default width is equal to (tile cell default width) x (rounded square root of the number of children), plus any gaps between children and any padding.

I think removing the width and height should do the trick.

Pbirkoff
Nice that works. But, doesn't work when I want the width to be fixed. I'm trying to create left menus like http://www.picnik.com/app#/create/shapes Any ideas on how this can be achieved?
Yeti
A: 

Hi,

Did you every find a solution where you could fix the width and the height would resize automatically. We're trying to do a similar thing...

Cheers,

Mike s

MIke
Yes, I used WindowShade (see my answer above)
Yeti
A: 

The WindowShade component from flexlib solved this. It can be found here: http://code.google.com/p/flexlib/wiki/ComponentList (look for WindowShade)

Here's a sample: http://flexlib.googlecode.com/svn/trunk/examples/WindowShade_Sample.swf

Yeti