Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android Flash Builder
Hello friends,
 
I am using SpinnerList in my applicaiton and by default it has a vertical layout. But I have a requirement of Horizontal SpinnerList.
 
I tried rotation but that was not enough.
 
    <s:titleContent>
       <s:SpinnerListContainer direction="ltr"  autoLayout="true">
           <s:SpinnerList id="titleSpinner" textAlign="center" >
               <s:ArrayList>
                  <fx:String>First</fx:String>
                  <fx:String>Second</fx:String>
                  <fx:String>Third</fx:String>
                  <fx:String>Fourth</fx:String>
                  <fx:String>Fifth</fx:String>
               </s:ArrayList>
           </s:SpinnerList>
       </s:SpinnerListContainer>
     </s:titleContent>
 
Please guide me
Posted 25-May-12 21:28pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello I found the solution. There no horizontal Spinner List. Therefore need to make a control.
 
<s:Scroller id="scrllr"
                    focusEnabled="false"
                    hasFocusableChildren="true"
                    width="100%">
            <s:HGroup id="hg" gap="20"
                      paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5">
                <s:Label text="First" color="White"
                     focusIn="textinput_focusInHandler(event)"/>
                <s:Label text="Second" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Third" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Fourth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Fifth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Sixth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
            </s:HGroup>
        </s:Scroller>
 

protected function textinput_focusInHandler(evt:FocusEvent):void
            {
                var idx:int = hg.getElementIndex(evt.target as IVisualElement);
                var lay:HorizontalLayout =  hg.layout as HorizontalLayout;
                if(lay.fractionOfElementInView(idx)<1)
                {
                    lay.horizontalScrollPosition +=lay.getScrollPositionDeltaToElement(idx).y;
                }
            }
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 686
1 OriginalGriff 345
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,795
1 Sergey Alexandrovich Kryukov 5,158
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,450


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100