Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6357937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:16:17+00:00 2026-05-24T23:16:17+00:00

I have a list component with a (row oriented) tile layout in a group

  • 0

I have a list component with a (row oriented) tile layout in a group that sits in the main Application.

I want the list to be centred vertically when there are not enough items in to fill the application window height, so verticalCenter=”0″.

However, when there are more items than can fit vertically on screen, the list expands beyond the application window height and the scrollbar doesn’t kick in.

I can remedy this if setting the list height to 100%, but that means it’s not vertically centred when it contains less items.

The ideal solution would be maxHeight=”100%”, but of course maxHeight doesn’t work with percentages. How would I go about achieving this behaviour?

Thanks,

Tim

Edit: Please see the code below:

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       applicationComplete="applicationCompleteHandler(event)"
                       width="800" height="600"
                       showStatusBar="false">
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayList;
            import mx.events.FlexEvent;

            protected function applicationCompleteHandler(event:FlexEvent):void
            {
                var arrayList:ArrayList = new ArrayList;
                for (var i:int = 1; i <= 50; i ++)
                {
                    arrayList.addItem(String(i));
                }
                list.dataProvider = arrayList;
            }

        ]]>
    </fx:Script>

    <s:List id="list"
            itemRenderer="itemRenderer"
            useVirtualLayout="false"
            horizontalCenter="0" verticalCenter="0"
            borderVisible="false">

            <s:layout>
                <s:TileLayout orientation="rows"
                              requestedColumnCount="4"
                              columnWidth="150" rowHeight="150"/>
            </s:layout>

        </s:List>


</s:WindowedApplication>

This is my item renderer:

<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx" 
                autoDrawBackground="true">

    <s:Rect width="100%" height="100%">
        <s:stroke>
            <s:SolidColorStroke color="0"/>
        </s:stroke>
    </s:Rect>

    <s:Label text="{data}"
             horizontalCenter="0" verticalCenter="0" fontSize="50"/>

</s:ItemRenderer>

If the for loop is changed to only 10 iterations, the list is centred vertically on the screen. Otherwise the list expands beyond the screen, centred vertically and no scrollbar appears.

Using clipAndEnableScrolling hasn’t made any difference. I’ve also tried putting the list inside a group with 100% width & height, but I’m getting more or less the same behaviour except the list is flush to the top when it is taller than the container.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:16:18+00:00Added an answer on May 24, 2026 at 11:16 pm

    You can try something like this:

    <s:List id="list" maxHeight="{list.height}" height="100%" />
    

    You could also change the maxHeight value whenever it’s parent container changes sizes.

    To get a complete answer, I think you’re going to have to show some code about how things are set up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a s:List component. I want to handle a click event to know
I have a custom component, that contains a list of another components. If I
i have list of rows that user select and i want to delete them,
I have an array list that could contain component or composite and each component
I have a List component that has drop-in CheckBox itemEditor that also serves as
I have a list component in my report that displays a set of data.Its
I have a list component on the stage in an AS3 movie. I populate
I have set the itemRollOver and itemRollOut event listeners on a List component, but
I have a component which has a List<T> property. The class in the list
I have a page-scoped component, which has an instance variable List with data, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.