I have a ButtonBar w/ a series of buttons that will each have a custom label:
- Person's name (fontsize 18)
- Person's address (fontsize开发者_如何学编程 12)
I am using Flex 4 w/ a custom-skinned spark buttonbar.
I've got the following but how do I now change the fontsizes? Do I change this label function or is that somehow controlled in the spark skin?
'
protected function customLabel(item:Object):String {
return item.name+ "\n" + item.address;
}
'
A labelFunction's purpose is to return a string that can be used by the component as a display string for the item in question. labelFunction has no relation to how the data is displayed.
I did not believe any Flex Components support different fontsizes. I would look into creating your own custom component that uses two separate labels; one for each font size. You can probably extend the Button class easy enough to make this happen, adding a new skin part and create a custom skin class that deal with the font sizes and positioning.
精彩评论