我想在同一个视图上添加底部和顶部标签栏 - 它是一个灵活的移动视图。我试过这个,但是当我在一个视图上创建两个标签栏时,只有一个被查看 - 底部的一个。但是,如果我删除底部的,它会显示上部的标签栏。关于在同一屏幕上显示它们有什么建议吗?
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
title="">
<s:TabbedViewNavigator id="tb_hastaUp" width="100%" height="100%" skinClass="skins.TabbedViewNavigatorSkin">
<s:ViewNavigator label="view1" width="100%" height="100%" firstView="views.view1" />
<s:ViewNavigator label="view2" width="100%" height="100%" firstView="views.view2" />
<s:ViewNavigator label="view3" width="100%" height="100%" firstView="views.view3" />
</s:TabbedViewNavigator>
<s:TabbedViewNavigator id="tb_hastaBottom" width="100%" height="100%" skinClass="spark.skins.mobile.TabbedViewNavigatorSkin">
<s:ViewNavigator label="view1" width="100%" height="100%" firstView="views.view1"/>
<s:ViewNavigator label="view2" width="100%" height="100%" firstView="views.view2" />
<s:ViewNavigator label="view3" width="100%" height="100%" firstView="views.view3" />
</s:TabbedViewNavigator>
</s:View>
这是我的 TabbedViewNavigatorSkin:
override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
{
super.layoutContents(unscaledWidth, unscaledHeight);
var tabBarHeight:Number = 0;
if (tabBar.includeInLayout)
{
tabBarHeight = Math.min(tabBar.getPreferredBoundsHeight(), unscaledHeight);
tabBar.setLayoutBoundsSize(unscaledWidth, tabBarHeight);
tabBar.setLayoutBoundsPosition(0, 0);
tabBarHeight = tabBar.getLayoutBoundsHeight();
// backgroundAlpha is not a declared style on ButtonBar
// TabbedViewNavigatorButtonBarSkin implements for overlay support
var backgroundAlpha:Number = (_isOverlay) ? 0.75 : 1;
tabBar.setStyle("backgroundAlpha", backgroundAlpha);
}
if (contentGroup.includeInLayout)
{
var contentGroupHeight:Number = (_isOverlay) ? unscaledHeight : Math.max(unscaledHeight - tabBarHeight, 0);
contentGroup.setLayoutBoundsSize(unscaledWidth, contentGroupHeight);
contentGroup.setLayoutBoundsPosition(0, tabBarHeight);
}
}
我想实现如下视图: