开发者

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;
}

'


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜