【问题标题】:How to change Flex 4 Radiobutton selected fontWeight如何更改 Flex 4 单选按钮选择的 fontWeight
【发布时间】:2011-05-02 17:02:58
【问题描述】:

我已经四处寻找了一段时间,但找不到任何东西。在 Flex 中,我需要能够将选中的 RadioButton 的 fontWeight 更改为粗体。因此,当一个 RadioButton 被选中时,它会调用 AS3 中的一个函数来设置所选 RadioButton 的 fontWeight...

valveRadioGroup.addEventListener(Event.CHANGE, changeRadioHandler);

private function changeRadioHandler(event:Event):void {         
    //change this RadioButton's fontWeight to bold
}

当它未被选中时,它还需要恢复到正常的 fontWeight。有谁知道这是否可能?谢谢!

【问题讨论】:

    标签: flash actionscript-3 flex4 radio-button flash-builder


    【解决方案1】:

    只需实现您自己的RadioButtonSkin(复制现有的)并在那里更改Label 声明:

    <s:Label id="labelDisplay" fontWeight.selectedStates="bold"
             textAlign="start"
             verticalAlign="middle"
             maxDisplayedLines="1"
             left="18" right="0" top="3" bottom="3" verticalCenter="2" />
    

    您可以使用 CSS 或直接使用 skinClass 属性应用此皮肤。

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 2021-04-09
      • 2017-12-07
      • 1970-01-01
      • 2011-02-15
      • 2011-05-22
      • 2020-05-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多