背景图像以某种方式掩盖了所有控件adobe flash builder 4.6

时间:2012-02-06 09:56:42

标签: flash-builder skins

我使用图像作为背景创建了一个皮肤。

当我的View将皮肤作为skinClass导入时,它会覆盖所有其他控件。

如何让所有控件显示在皮肤上方?

这是我的皮肤代码,名为Background.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark">
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.supportClasses.SkinnableComponent")]
    </fx:Metadata>
    <s:Image source="assets/Sunflower.gif" smooth="true" left="0" right="0" top="0" bottom="0">

    </s:Image>

    <s:states>
        <s:State name="normal" />

    </s:states>

</s:Skin>

这是默认包

下的主视图
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                  xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"

                                   skinClass="BackgroundImage"
                                  >
    <s:ViewNavigator label="Add" width="100%" height="100%" firstView="views.AddView"/>
    <s:ViewNavigator label="List" width="100%" height="100%" firstView="views.ListView"/>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
</s:TabbedViewNavigatorApplication>

1 个答案:

答案 0 :(得分:0)

看起来您的Z指数应该针对控件进行调整。 您可以像这样更改z-index:

parent.setChildIndex(childObject, i)

因此,例如,如果您希望控件始终位于前面,则需要:

myControls.parent.setChildIndex(myControls, myControls.parent.numChildren -1)

希望这对你有所帮助,即使没有任何代码也难以回答......

相关问题