3

I have a problem with the TabNavigator. The labels of the tabs are getting truncated and once the user places their mouse over the tab it redraws again. Is there anyway to redraw the label of the tab programmatically?

Jason Towne
  • 8,014
  • 5
  • 54
  • 69
Naveen
  • 141
  • 2
  • 16

3 Answers3

0

I had the same problem with TabNavigator. It was related to TitleWindow where my TabNavigator was located.

This is cool solution from - How to Show a Tab Navigator in a Popup Window

package
{
    import mx.containers.TabNavigator;
    import mx.controls.Button;
    import mx.events.FlexEvent;

    public class PopUpFriendlyTabNavigator extends TabNavigator
    {
        public function PopUpFriendlyTabNavigator()
        {
            super();

            this.addEventListener (FlexEvent.CREATION_COMPLETE, onCreationComplete);
        }

        private function onCreationComplete(event:FlexEvent):void
        {
            this.removeEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete);

            var firstTab:Button = getTabAt(0);

            if (firstTab)
            {
                firstTab.invalidateDisplayList();
                firstTab.validateNow();
            }
        }
    }
} 
0

Try using a Spark TabBar with a ViewStack instead.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
0

You may also want to consider the SuperTabNavigator in FlexLib.

Jason Towne
  • 8,014
  • 5
  • 54
  • 69