gpt4 book ai didi

apache-flex - 使 spark ButtonBar 表现得像 mx ToggleButtonBar Flex 4

转载 作者:行者123 更新时间:2023-12-01 12:56:53 25 4
gpt4 key购买 nike

大家好,我有下面的代码来在 spark 中定义一个按钮栏控件:

<s:ButtonBar id="tabs" y="15" left="0" height="31" change="VideosMenuBar_changeHandler(event)">  
<s:ArrayCollection>
<fx:String>Latest Videos</fx:String>
<fx:String>Last Week Videos</fx:String>
<fx:String>Last Month Videos</fx:String>
</s:ArrayCollection>
</s:ButtonBar>

我有几个问题:

2)如何定义默认按下的按钮?

3) 最后,我在我的应用程序中应用了现成的 flex 皮肤,这为我的按钮提供了一些悬停、选中等属性,我如何通过按钮上的新皮肤定义我自己的皮肤?我为我的按钮栏定义了新属性,以免受到皮肤中声明的属性的影响,或者我是否必须更改该皮肤中的某些内容,如何才能做到这一点?

非常感谢您的帮助!

最佳答案

  1. 确实如此。 requireSelection="真"
  2. ButtonBar 扩展了 List,因此设置 selectedIndex 属性应该有效
  3. 我不太确定你的意思,但你可以使用 css 更改按钮栏中按钮的外观:

    s|ButtonBarButton { 皮肤类:ClassReference("my.skin.class");

或者您可以通过创建自己的 ButtonBarSkin 来引用您的按钮来选择自定义按钮实现。

<fx:Declarations>
<fx:Component id="firstButton">
<you:MyLastButton />
</fx:Component>

<fx:Component id="middleButton" >
<you:MyLastButton />
</fx:Component>

<fx:Component id="lastButton" >
<you:MyLastButton />
</fx:Component>
</fx:Declarations>

看看 Spark 自己的 ButtonBarSkin 作为一个很好的例子,并确保这些按钮至少实现 IItemRenderer 或只是扩展 ButtonBarButton

关于apache-flex - 使 spark ButtonBar 表现得像 mx ToggleButtonBar Flex 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9192821/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com