我需要开发一个标签导航器,左侧有几个标签,右侧有一个标签,我已尝试过“tabOffset”属性,但这似乎无法提供帮助
提前致谢!
答案 0 :(得分:3)
我制作了自定义TabNavigator组件。
package
{
import mx.containers.TabNavigator;
import mx.controls.Button;
import mx.events.FlexEvent;
public class CustomTabNavigator extends TabNavigator
{
public function CustomTabNavigator()
{
super();
}
override protected function createChildren(): void
{
super.createChildren();
tabBar.addEventListener(FlexEvent.CREATION_COMPLETE, addSpacer);
}
public function addSpacer(event: FlexEvent): void
{
var buttonCount: int = tabBar.getChildren().length;
var _width : Number = this.width;
var button: Button = tabBar.getChildAt(buttonCount-1) as Button;
_width = _width - button.width;
button.x = _width;
}
}
}