css - 如何设置 MX Panel 标题背景色

标签 css actionscript-3 air panel

我想设置 MX Panel 的背景颜色。我可以更改标题的文本颜色但不能更改背景颜色。

我正在使用下面的代码:

.Panel {
        textAlign: center;
        borderColor: #33cccc;
        borderThicknessLeft: 6;
        borderThicknessTop: 0;
        borderThicknessBottom: 10;
        borderThicknessRight: 6;
        roundedBottomCorners: true;
        cornerRadius: 8;
        headerHeight: 22;
        backgroundAlpha: 0.97;
        highlightAlphas: 0.34, 0.06;
        dropShadowEnabled: true;
        shadowDistance: 8;
        shadowDirection: left;
        dropShadowColor: #5b3d24;
        titleStyleName: "mypanelTitle"; 

    }

    .mypanelTitle {
        background-color: #5b3d24;
        color: #5b3d24;
        background: #5b3d24;
        fontFamily: Arial;
        fontSize: 12;
        fontWeight: bold;
    }

请帮我设置标题颜色。

谢谢 卡 PIL

最佳答案

你尝试过 backgroundColor 吗?它适用于我的 mx:Panel (flex 4.6)。

更新:

对不起,我之前的回答不正确。如果您使用 Halo 主题,您可以尝试 headerColors 样式属性(我现在无法测试)。

第二种方式 - 为标题创建您自己的自定义皮肤。它将看起来像下一个:

Main.mxml

<mx:Panel x="428" y="21" width="250" height="200" layout="absolute" title="Title Text" titleBackgroundSkin="CustomTitleBackgroundSkin">

CustomTitleBackgroundSkin.as

package
{
import mx.core.UIComponent;

public class CustomTitleBackgroundSkin extends UIComponent
{
    public function CustomTitleBackgroundSkin()
    {
        super();
    }

    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    {
        graphics.clear();
        graphics.beginFill(0xff0000);
        graphics.drawRect(0, 0, width, height);
        graphics.endFill();
    }
}
}

附言在 css 属性中,titleBackgroundSkin 将是下一个:

    .panel {
        titleBackgroundSkin: ClassReference("CustomTitleBackgroundSkin");
    }

关于css - 如何设置 MX Panel 标题背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25219526/

相关文章:

actionscript-3 - AS3 [Event(name ="", type ="")],有什么意义?

ios - 在 windows 上使用 flash professional cc 和 adobe air 13 在 ios 应用程序上推送通知

flash - 为什么补间随机停止?

apache-flex - 加载和运行现有 AIR swf 的 AIR 应用程序

apache-flex - 在 Flex 中禁用 WindowedApplication 调整大小

html - 格式未应用 CSS

javascript - 从 JS 中的 insertRule() 更新或删除 css 规则

javascript - 在javascript中没有 Canvas 缩放到光标

actionscript-3 - 使用 Adob​​e AIR 获取任何 USB 磁盘信息

css3渐变和 Sprite 同时出现