user770869
user770869

Reputation: 1

Flex grid automatic width

I have three griditems in a grid row. Two with fixed width. How can i make the third scale automatically to maximize the grid?

I'd like the same functionality as html:

<table width="100%">
<tr><td width=50></td>
<td>this scales</td>
</td><td width=50></td></tr></table>

Regards Anders

Upvotes: 0

Views: 492

Answers (1)

Constantiner
Constantiner

Reputation: 14221

I think this code snippet can help you:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Grid bottom="0" left="0" right="0" top="0">
        <mx:GridRow width="100%">
            <mx:GridItem width="50">
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem width="50">
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem width="100%">
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem width="50">
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
        </mx:GridRow>
        <mx:GridRow width="100%">
            <mx:GridItem>
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem>
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem>
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
            <mx:GridItem>
                <mx:Button label="Test" width="100%" />
            </mx:GridItem>
        </mx:GridRow>
    </mx:Grid>
</mx:Application>

Upvotes: 1

Related Questions