Skip navigation
Currently Being Moderated

vertical layout of List and Button

Dec 4, 2012 7:55 PM

i want to display a button just below a list,the dataProvider of the list is dynamic,i want the height of the list to be x*y if it has x items and the height of each item is y.The problem is that when the height of the list is less than the sceen height,it will be out of expect like this.can anybody help me out?


here is my code:




            import mx.collections.ArrayCollection;


            private var ac:ArrayCollection = new ArrayCollection([{name:"apple"},{name:"orange"},{name:"pear"}]);



    <s:VGroup width="100%" gap="0">

        <s:Label width="100%" text="list:" fontSize="20"/>

        <s:List id="lst" width="100%" dataProvider="{ac}" itemRenderer="views.myItemrenderer2"

                horizontalScrollPolicy="auto" verticalScrollPolicy="on" >


        <s:Button width="100%" label="click me"/>       


----------------------myItemrenderer.xml------------------------------ -------

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

<s:ItemRenderer xmlns:fx=""





    <s:BorderContainer width="100%" height="100%">   

        <s:HGroup width="100%" height="100%" horizontalAlign="center" verticalAlign="middle"

                  paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5">

            <s:Label width="100%" height="100%" text="{}" textAlign="left"  verticalAlign="middle" fontSize="20" fontWeight="bold"/>




---------------------------------------------------------------------- -----


More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points