TitleWindow 中的按钮颜色错误
我有一个 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?
<?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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就我个人而言,我会尝试使用按钮本身的
styleName
为按钮添加颜色,除非您确实希望 TitleWindow 下的所有按钮均为红色。在这种情况下,我相信它没有显示在
controlBarContent
中的原因是它不是TitleWindow
的直接后代,因为该属性实际上只是将其添加到在TitleWindow
下分组(根据面板的默认皮肤)。无论如何,如果我是你,我会这样做:
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 ofTitleWindow
since that property actually just adds it to a Group (as per the default skin of Panel) underTitleWindow
.Anywho, if I were you I'd do this instead: