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

发布于 2025-01-03 00:52:20 字数 1440 浏览 0 评论 0原文

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

当我的视图将皮肤导入为 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>

I created a skin using an image as background.

When my View imported the skin as skinClass, it covers up all the other controls.

How do i make all the controls display above the skin?

This is my Skin code called 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>

This is the main view under default package

<?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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青朷 2025-01-10 00:52:20

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

parent.setChildIndex(childObject, i)

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

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

希望这对您有帮助,即使没有任何代码很难回答它......

It looks like your Z index should be adjusted for the controls.
You can change your z-index like this:

parent.setChildIndex(childObject, i)

So for example if you want your controls to always be on front you need:

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

Hope this helps you, even tho it's hard to answer it without any code...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文