0

I would like my TabBar to have the ability to show if there are more menu items on either the left or the right. Else the user may not know that more options exist. Something like either arrows to indicate more items or even some sort of beveled effect on the last visible tab item so that it suggests more options are off screen. This is how my TabBar looks like with an arrow showing how the other items are just cut off: enter image description here

Here is the code of the TabBarSkin:

public class ScollingTabBarSkin extends TabbedViewNavigatorTabBarSkin
{
    public var scroller:Scroller;

    /**
     *  Override createChildren() to create a Scroller and add the DataGroup
     *  as its viewport.
     */
    override protected function createChildren():void
    {
        super.createChildren();

        // use a standard HorizontalLayout instead of a specialized layout
        var tabLayout:HorizontalLayout = new HorizontalLayout();
        tabLayout.useVirtualLayout = false;
        tabLayout.gap = 0;
        tabLayout.variableColumnWidth = false;
        tabLayout.columnWidth = 400;

        dataGroup.layout = tabLayout;

        scroller = new Scroller();
        scroller.setStyle('interactionMode', InteractionMode.TOUCH);
        scroller.viewport = dataGroup;
        addChild(scroller);
    }

    /** 
     * Size and position the Scroller
     */
    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
    {
        setElementPosition(scroller, 0, 0);
        setElementSize(scroller, unscaledWidth, unscaledHeight);
    }
}

Taken from:http://flexponential.com/2011/10/23/enable-scrolling-in-the-tab-bar-of-a-tabbedviewnavigator/comment-page-1/#comment-78685

ketan
  • 19,129
  • 42
  • 60
  • 98
Dave
  • 598
  • 2
  • 4
  • 17
  • All your code does is create some extra space to the left and right of the scroller. Did you mean to ask a question? – drkstr101 Nov 13 '13 at 22:23
  • @drkstr1 Yes I was trying to add space to place the indication of content to the right and left (was thinking of arrows). I removed it from the question since it wasn't doing much like you said. What I want is someone to give me a hint about how to do that on my code. – Dave Nov 14 '13 at 13:27

0 Answers0