So after discovering that the ButtonBar does not allow facility for resizing the width of a button, I had the choice. If i was going to extract the buttons from the ButtonBar, it probably would make sense to have them as a different type - Button for example. But reskinning my buttons as a different type could be time-consuming so I thought I'd see how I go just using ButtonBarButtons that aren't in a ButtonBar!
All turned out fine, except that my labels weren't appearing. A little delving into the code and I discovered the following code inside spark.components.supportClasses.ButtonBase:
// Push down to the part only if the label was explicitly set
if (_content !== undefined)
labelDisplay.text = label;
For my two cents, there's something strange going on there... So to set the label, I need to put the text inside the label property, and i need to ensure that content is not undefined. Set content to something arbitrary and the label appears! weird...
<s:ButtonBarButton label="Title" content="nada"/>
1 comment:
You could change the default layout specified in ButtonBarSkin.as file from ButtonBarHorizontalLayout to the some custom layout.
For example, have a look at this implementation of Horizontal Multiline Layout by Max Kachurovskiy
http://kachurovskiy.com/2010/horizontal-multiline-layout
Post a Comment