0

我在 s:TabbedViewNavigatorApplication 中有 as:ViewNavigator 组件。目前它显示在底部。如何让它显示在操作栏下方的应用程序顶部?虽然我在 flex sdk 中查看了所有相关的皮肤,但我没有发现任何与位置有关的东西。

PS 这是 Flash Builder 4.6 中的移动应用程序

在 s:TabbedViewNavigatorApplication 组件中:

var nav:ViewNavigator = new ViewNavigator();
nav.label = "Newest";
nav.firstView = HomeView;
nav.firstViewData = "recent";
nav.percentWidth = 100;
nav.percentHeight = 100;

this.addElement(nav);
nav.titleContent = [];

s:TabbedViewNavigatorApplication 皮肤的变化:(交换了 if 语句)(将 tabBar 的 y 位置更改了 60)

if (contentGroup.includeInLayout)
        {
            var contentGroupHeight:Number = (_isOverlay) ? unscaledHeight : Math.max(unscaledHeight - tabBarHeight, 0);
            contentGroup.setLayoutBoundsSize(unscaledWidth, contentGroupHeight);
            contentGroup.setLayoutBoundsPosition(0, 0);
        }
        if (tabBar.includeInLayout)
        {
            tabBarHeight = Math.min(tabBar.getPreferredBoundsHeight(), unscaledHeight);
            tabBar.setLayoutBoundsSize(unscaledWidth, tabBarHeight);
            tabBar.setLayoutBoundsPosition(0, 60); //unscaledHeight - tabBarHeight
            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);
        }

ViewNavigator 皮肤的变化:

(从 contentGroupHeight 中删除 (-) contentGroupPosition)

(将 contentGroupPosition 乘以 2,以便应用程序中的其他元素不会低于 buttonBar。操作栏和 buttonBar 必须具有相同的大小才能正常工作,并且无法从 vieNavigator 访问按钮栏本身的高度据我所知,皮肤)

if (contentGroup.includeInLayout)
        {
            // If the hostComponent is in overlay mode, the contentGroup extends
            // the entire bounds of the navigator and the alpha for the action 
            // bar changes
            // If this changes, also update validateEstimatedSizesOfChild
            var contentGroupHeight:Number = (_isOverlay) ? unscaledHeight : Math.max(unscaledHeight - actionBarHeight, 0);
            var contentGroupPosition:Number = (_isOverlay) ? 0 : actionBarHeight;

            contentGroup.setLayoutBoundsSize(unscaledWidth, contentGroupHeight-contentGroupPosition);
            contentGroup.setLayoutBoundsPosition(0, contentGroupPosition*2);
        }
4

0 回答 0