Skip to content

Spark Label linebreak

Monday, November 21, 2011

[Note to Self]

You can’t simply set the text of an MXML declared Spark Label like below and expect linebreak or carriage returns to work:

<s:Label text="this is where I desire my line break to be\nnow the second line begins....."
         maxDisplayedLine="2"/>

You now have to explicitly wrap the linebreak or carriage return in binding brackets and single quotes like so:

<s:Label text="this is where I desire my line break to be{'\n'}now the second line begins....."
         maxDisplayedLine="2" 
         lineBreak="explicit"/>
Advertisement

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.