开发者

flex tabnavigator cuts off labels

I have a problem with the TabNavigator. The labels of the tabs are getting truncated and once th开发者_如何学Ce user places their mouse over the tab it redraws again. Is there anyway to redraw the label of the tab programmatically?


You may also want to consider the SuperTabNavigator in FlexLib.


Try using a Spark TabBar with a ViewStack instead.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜