tefozi
tefozi

Reputation: 5480

DataGroup TileLayout autoheight

I have DataGroup with TileLayout. How to make datagroup resize accordingly to number of elements in datagroup?

For example 1 have 1 row with 4 elements. Each element is 20 pixels tall. So I want my datagroup to be 20 pixels tall as well. If I have 7 elements which will be 2 rows I want my datagroup to be 40 pixels tall and so on.

Right now for datagroup with 1 row is about 100px tall.

Upvotes: 1

Views: 1218

Answers (1)

tefozi
tefozi

Reputation: 5480

Found workaround:

private function onCreationComplete(event:Event):void
{
    dataGroup.height = (dataGroup.layout as TileLayout).rowCount * ((dataGroup.layout as TileLayout).rowHeight + (dataGroup.layout as TileLayout).verticalGap);
}

Upvotes: 2

Related Questions