使用 CSS 设置 Flex MX 按钮背景颜色

发布于 2024-10-31 10:01:14 字数 545 浏览 5 评论 0原文

如何使用 CSS 设置 Flex MX 按钮的背景颜色?我的按钮声明为:

<mx:Button label="My Button"/>

CSS 为:

@namespace mx "library://ns.adobe.com/flex/mx";

mx|Button {
    color: #66ffff;
    backgroundColor: #333333;
}

backgroundColor 似乎不是 MX 按钮背景颜色的正确 CSS 属性。查看 Flex API 文档,我尝试了 fillColors 但没有任何作用。

是否可以使用 CSS 更改 mx.controls.Button 的背景颜色?

Using CSS, how do I set the background color of a Flex MX Button? My button is declared as:

<mx:Button label="My Button"/>

And the CSS is:

@namespace mx "library://ns.adobe.com/flex/mx";

mx|Button {
    color: #66ffff;
    backgroundColor: #333333;
}

backgroundColor doesn't seem to be the correct CSS property for MX Button's background color. Looking at the Flex API docs, I tried fillColors but that didn't do anything.

Is it possible to change mx.controls.Button's background color using CSS?

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

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

发布评论

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

评论(1

薄荷→糖丶微凉 2024-11-07 10:01:14

尝试

Button {
   fillAlphas: 1, 1, 1, 1;
   fillColors: #66ffff, #66ffff, #66ffff, #66ffff;
}

即使我尝试使用外部 .css 文件,

您也可以使用 创建它Flex Style Explorer 并通过以下语句导入:

<mx:Style source="yourstylesheet.css" />

try

Button {
   fillAlphas: 1, 1, 1, 1;
   fillColors: #66ffff, #66ffff, #66ffff, #66ffff;
}

Even if i'd try to use an external .css file

You can create it with Flex Style Explorer and import it by the following statement:

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