TitleWindow 中的按钮颜色错误

发布于 2024-11-09 21:03:40 字数 975 浏览 3 评论 0原文

我有一个 TitleWindow,里面有 2 个按钮。 一个按钮位于内容组中,另一个按钮位于控制栏组中。 标题窗口和按钮采用 chromecolor 样式。

为什么书房控制栏中的按钮不是红色的?

如何获得红色按钮?

在此处输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow     xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            horizontalCenter="0" verticalCenter="0"
            width="300" height="400"
            isPopUp="true">

             <s:Button label="Red Button" />

             <s:controlBarContent>
                 <s:Button label="Red Button"  />
             </s:controlBarContent>
</s:TitleWindow>

Style.css:

s|TitleWindow{
    chromeColor: #00FF00;  //Green
    backgroundColor: #0000FF; //Blue

}

s|TitleWindow s|Button{
    chromeColor: #FF0000; //Red
}  

I've got a TitleWindow with 2 buttons in it.
One button is in the contentgroup and the other in the controlbargroup.
Titlewindow and buttons are styled with chromecolor.

Why has the button in den controlbar not a red color?

How can I get a red button?

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow     xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            horizontalCenter="0" verticalCenter="0"
            width="300" height="400"
            isPopUp="true">

             <s:Button label="Red Button" />

             <s:controlBarContent>
                 <s:Button label="Red Button"  />
             </s:controlBarContent>
</s:TitleWindow>

Style.css:

s|TitleWindow{
    chromeColor: #00FF00;  //Green
    backgroundColor: #0000FF; //Blue

}

s|TitleWindow s|Button{
    chromeColor: #FF0000; //Red
}  

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

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

发布评论

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

评论(1

书间行客 2024-11-16 21:03:40

就我个人而言,我会尝试使用按钮本身的 styleName 为按钮添加颜色,除非您确实希望 TitleWindow 下的所有按钮均为红色。

在这种情况下,我相信它没有显示在 controlBarContent 中的原因是它不是 TitleWindow 的直接后代,因为该属性实际上只是将其添加到在 TitleWindow 下分组(根据面板的默认皮肤)。

无论如何,如果我是你,我会这样做:

s|Button.red
{
   chrome-color:#FF0000;
}

<s:Button label="Red" styleNane="red" />

Personally, I would try to add the colors to my button using a styleName on the button themselves unless you really want all buttons under TitleWindow to be red.

In this case, I believe the reason why it isn't being shown in the controlBarContent is because it's not a direct descendant of TitleWindow since that property actually just adds it to a Group (as per the default skin of Panel) under TitleWindow.

Anywho, if I were you I'd do this instead:

s|Button.red
{
   chrome-color:#FF0000;
}

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