kristen
kristen

Reputation: 488

Spark button ... labelfunction w/ 2 diff. font sizes

I have a ButtonBar w/ a series of buttons that will each have a custom label:

  1. Person's name (fontsize 18)
  2. 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;
}

'

Upvotes: 0

Views: 524

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

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.

Upvotes: 1

Related Questions