2 Replies Latest reply on Dec 21, 2010 5:14 PM by saisri2k2

    Resize spark list depending on the dataProvider length

    saisri2k2 Level 4

      How to Resize spark list height depending on the data length?

        • 1. Re: Resize spark list depending on the dataProvider length
          Peter deHaan Level 4

          I believe the Spark List does resize to match the number of items in the data provider. Although it may be constrained to a minimum height/width as defined by it's skin though (112px by 112px, if I recall correctly).


          You can probably either try creating a custom Spark List skin without the minWidth and minHeight and see if that helps, or you may have to override the default List layout if you have fewer than 5 items in  your list data provider:


          <?xml version="1.0" encoding="utf-8"?>

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"




                  <s:Button id="sdkVer" initialize="sdkVer.label = mx_internal::VERSION;" click="System.setClipboard(sdkVer.label);" />



                  <s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10" />



              <s:List labelField="fontName">


                      <s:VerticalLayout gap="0"  horizontalAlign="contentJustify" requestedRowCount="-1" />



                      <s:ArrayCollection source="{Font.enumerateFonts(true).splice(-3)}" />







          1 person found this helpful