无渐变的 Flex 按钮

发布于 2024-11-16 18:06:17 字数 394 浏览 3 评论 0原文

如何在 Flex (SDK 3.3) 中创建一个没有任何渐变或边框颜色的简单按钮?我的 CSS 如下所示。我仍然得到渐变和不同的边框颜色,我只想要一个普通的、方形的、纯色的按钮。

谢谢!

Button {
    fontWeight:normal;
    color:white;
    fillAlphas: 1, 1, 1, 1;
    fillColors: "0x0087B8", "0x0087B8","0x4A1870", "0x4A1870";
    cornerRadius: 0;
    focusAlpha: 1;
    borderColor:"0x0087B8";
    borderAlpha:1;
    textRollOverColor: white;

}

how can I create a simple button in Flex (SDK 3.3) without any gradient or border color? My CSS is shown below. I still get gradient and different border color, I just want a plain, square, solid color button.

thanks!

Button {
    fontWeight:normal;
    color:white;
    fillAlphas: 1, 1, 1, 1;
    fillColors: "0x0087B8", "0x0087B8","0x4A1870", "0x4A1870";
    cornerRadius: 0;
    focusAlpha: 1;
    borderColor:"0x0087B8";
    borderAlpha:1;
    textRollOverColor: white;

}

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

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

发布评论

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

评论(1

寄风 2024-11-23 18:06:17

感谢您的输入,我必须创建一个像这样的程序皮肤:

    public class TIMPButtonSkin extends ProgrammaticSkin
{
    public var backgroundFillColor:Number;
    public var lineThickness:Number;

    public function TIMPButtonSkin()
    {
        super();

    }

    override protected function updateDisplayList(w:Number, h:Number):void {

        var btn:Button = parent as Button;
        btn.buttonMode = true;

        switch (name) {
            case "upSkin":
                backgroundFillColor = 0x0087B8;
                break;
            case "overSkin":
                backgroundFillColor = 0x4A1870;
                break;
            case "downSkin":
                backgroundFillColor = 0x4A1870;
                break;
            case "disabledSkin":
                break;
        }

        // Draw the box using the new values.
        var g:Graphics = graphics;
        g.clear();
        g.beginFill(backgroundFillColor,1.0);
        g.lineStyle(lineThickness, 0xFF0000);
        g.drawRect(0, 0, w, h);
        g.endFill();
    }
}

CSS 看起来像这样:

Button {
fontWeight:normal;
color:white;
cornerRadius: 0;
textRollOverColor: white;
textSelectedColor:white;
skin: ClassReference("TIMP.TIMPButtonSkin");  

}

Thanks for your input, I had to create a programmtic skin like this:

    public class TIMPButtonSkin extends ProgrammaticSkin
{
    public var backgroundFillColor:Number;
    public var lineThickness:Number;

    public function TIMPButtonSkin()
    {
        super();

    }

    override protected function updateDisplayList(w:Number, h:Number):void {

        var btn:Button = parent as Button;
        btn.buttonMode = true;

        switch (name) {
            case "upSkin":
                backgroundFillColor = 0x0087B8;
                break;
            case "overSkin":
                backgroundFillColor = 0x4A1870;
                break;
            case "downSkin":
                backgroundFillColor = 0x4A1870;
                break;
            case "disabledSkin":
                break;
        }

        // Draw the box using the new values.
        var g:Graphics = graphics;
        g.clear();
        g.beginFill(backgroundFillColor,1.0);
        g.lineStyle(lineThickness, 0xFF0000);
        g.drawRect(0, 0, w, h);
        g.endFill();
    }
}

The CSS looks like this:

Button {
fontWeight:normal;
color:white;
cornerRadius: 0;
textRollOverColor: white;
textSelectedColor:white;
skin: ClassReference("TIMP.TIMPButtonSkin");  

}

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