Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon
Accepted Solution

label background color

How can I set the background color of my TextFormat?

Just want a white background.

Thanks

Highlighted
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: label background color

hey,

 

to set a background to your label, you can use the graphics package. use the following code sample as a guide. it creates a red background to the text. also note that i added 5 pixels to the height and width of the label size to accomodate the weird margin adddd to the label object:

 

 

var myLabel:Label = new Label();

myLabel.text = "I should have a background color to me";

myLabel.setSize(myLabel.textWidth + 5, myLabel.textHeight + 5);

myLabel.graphics.beginFill(0xFF0000);
myLabel.graphics.drawRect(0,0,myLabel.width, myLabel.height);
myLabel.graphics.endFill();

addChild(myLabel);

 

Hope that helps. good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman