【问题标题】:Alert styles in SparkSpark 中的警报样式
【发布时间】:2013-03-19 09:49:38
【问题描述】:

在 Flex 3 中,我为警报组件定义了以下样式:

Alert 
{
    messageStyleName: alertMessageStyle;
    titleStyleName: alertTitleStyle;
    buttonStyleName: alertButtonStyle;
}

.alertMessageStyle
{
    borderStyle: solid;
    borderAlpha: 0;
    roundedBottomCorners: true;
    cornerRadius: 9;
    headerHeight: 20;
    backgroundAlpha: 0.9;
    highlightAlphas: 0, 0;
    headerColors: #ffffff, #ffffff;
    backgroundColor: #ffffff;
    shadowDistance: 4;
    shadowDirection: right;
    dropShadowColor: #333333;
    color: #666666;
    textAlign: center;
    fontFamily: Arial;
    fontSize: 14;
    fontWeight: bold;
}

.alertTitleStyle
{
    color: #666666;
    backgroundColor: #ff0000;
    textAlign: center;
    fontFamily: Arial;
    fontSize: 13;
    fontWeight: bold;
}

.alertButtonStyle
{
    fontFamily: Arial;
    fontSize: 12;
    backgroundColor: #ff0000;
}

现在我正在迁移到 Flex 4 并且 Spark 没有警报组件,所以我使用相同的样式并添加了 mx|Alert,但只有消息样式有效!标题和按钮样式被忽略! 有人可以解释一下如何让它们工作吗?谢谢。

【问题讨论】:

    标签: apache-flex flex4


    【解决方案1】:

    标题和按钮样式适用于 4.6 flex 框架。修复 .alertButtonStyle 并使用 chromeColor 如果你想改变背景:

    .alertButtonStyle
    {
        fontFamily: Arial;
        fontSize: 12;
        chromeColor : #ff0000;
    }
    

    .alertTitleStyle 类申请titleTextField:UITextField;仅使用字体样式等样式。

    【讨论】:

    • 试试看:chrome-color: "0x00FF00";你用的是什么flex版本?
    【解决方案2】:

    您必须添加mx|Button 样式,它会自动添加到警报按钮。我正在使用此代码。

    mx|Alert{
        borderColor: #0066cc;
        borderThicknessLeft: 3;
        borderThicknessTop: 1;
        borderThicknessBottom: 3;
        borderThicknessRight: 3;
        cornerRadius: 3;
        headerHeight: 30;
        backgroundAlpha: 1;
        highlightAlphas: 0.36, 0;
        headerColors: #003366, #0066cc;
        footerColors: #e7e7e7, #c7c7c7;
        backgroundColor: #ffffff;
        shadowDistance: 2;
        dropShadowColor: #333333;
        titleStyleName: "AlertTitle";
        color:#000000;
    }
    
    .AlertTitle {
        color: #ffffff;
        fontFamily: Arial;
        fontSize: 12;
        fontWeight: bold;
    }
    

    和按钮

    mx|Button{
        fontFamily: Arial;
        fontSize: 11;
        fontWeight: bold;
        color: #333333;
        textRollOverColor: #444444;
        textSelectedColor: #000000;
    
        upSkin:Embed("assets/images/btn_common_n.jpg");
        downSkin:Embed("assets/images/btn_common_h.jpg");
        overSkin:Embed("assets/images/btn_common_h.jpg");
        skin:Embed("assets/images/btn_common_n.jpg");*/
    
    
    }
    

    【讨论】:

    • 好的,所以当我使用 mx|Button 时,它应用了 chrome 颜色,但它仍然不适用于标题...
    • 主题可能有问题。我默认使用 HALO 主题。
    • 它可能不适用于 Spark 主题。您或其他人有 Spark 的解决方案吗?
    • 不,我也面临着火花主题的许多设计问题,这就是我切换到 HALO 主题的原因,它对我来说很好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-30
    • 1970-01-01
    • 1970-01-01
    • 2011-02-01
    • 1970-01-01
    • 2015-08-17
    相关资源
    最近更新 更多