开发者

Set Spark button width in ButtonBar

How do I set the individual button sizes in a Spark ButtonBar? It used to be something like:

<mx:ButtonBar id="myButtonBa开发者_开发百科r" buttonHeight="12" buttonWidth="250" >

I get an error when I try to do the same in Spark:

Cannot resolve attribute 'buttonHeight' for component type spark.components.ButtonBar

I don't want to create a separate skin...just something that will work inline if possible


Just set its layout.

<s:ButtonBar id="myButtonBar">
    <s:layout>
        <s:HorizontalLayout variableColumnWidth="false" gap="0" columnWidth="250"/>
    </s:layout>
</s:ButtonBar>

Many things are just different in Spark :)


I see two different ways to approach this.

  1. Create a custom skin class and set the Button Width that way. You'll have to review the existing ButtonBar Skin to figure out specifics.
  2. Extend the button class to set he new button width and use that class to create new factories for the button related skin parts

You could also roll back to the Flex 3 ButtonBar and use the buttonWidth style. Some things are just easier in Halo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜