开发者

flex tabnavigator cuts off labels

开发者 https://www.devze.com 2023-03-06 12:22 出处:网络
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 lab

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

精彩评论

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