Flex - How to change open DropDownList height

Travesty3 picture Travesty3 · Feb 18, 2010 · Viewed 19.2k times · Source

Using FB4, I want to change the height of an open spark DropDownList. By default, it shows up to 6 items before scrolling. My dropdownlist contains 7 items, so I want to change the height of the open dropdown list to fit all 7 items without scrolling. As a workaround, I've changed the font size of the items so that they are smaller and all 7 fit, but the smaller font doesn't look good. Is there a way to change this height? I'm rather new to Flash, so if it's a complicated solution, please be detailed :-).

Answer

Mansuro picture Mansuro · Aug 17, 2011

Isn't it easier if you use the property requestedRowCount of the verticalLayout?

<s:DropDownList dataProvider="{myDataProvider}">
    <s:layout>
        <s:VerticalLayout requestedRowCount="10"/>
    </s:layout>
</s:DropDownList>