Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-22-2008, 02:57 PM   #1 (permalink)
Registered Member
 
Join Date: May 2008
Posts: 44
Default UILabel background color

Hey guys,

does anyone know how to change the background color of a UILabel? I create a frame and pass the frame for the initialization to the label. By default the label's background comes out white, but I'd like it to be either black or transparent.

Thanks!
-mademo
mademo is offline   Reply With Quote
Old 05-23-2008, 01:49 AM   #2 (permalink)
New Member
 
Nitrex88's Avatar
 
Join Date: Apr 2008
Location: Long Island, NY
Age: 21
Posts: 84
Send a message via AIM to Nitrex88 Send a message via Skype™ to Nitrex88
Default Re: UILabel background color

Sure, this can be done like this...
Code:
//pretend the name of you label is myLabel
myLabel.backgroundColor = [UIColor blackColor];

--or--

myLabel.backgroundColor = [UIColor clearColor];
Pick either the top line or the bottom or any other color you want. Hope that helped.

Nitrex88
Nitrex88 is offline   Reply With Quote
Old 05-23-2008, 12:22 PM   #3 (permalink)
Registered Member
 
Join Date: May 2008
Posts: 44
Default Re: UILabel background color

thanks!
mademo is offline   Reply With Quote
Old 02-10-2010, 10:04 AM   #4 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 12
Default

Yes but that is OK when you write your code into the process :

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {

....
}

But if you write your code for example into


Code:
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
...
}
This is a méthod of a pickerViewController.

That isn't OK , your label don't change the color background

Then what you purpose ?
Minos is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Change Color/Style of the iPhone Status Bar seanhelmes iPhone SDK Development 8 01-05-2010 05:54 PM
Default TableView section header background color jonc iPhone SDK Development 4 01-04-2009 12:18 AM
how to make ur application to run in background i.d3v1l iPhone SDK Development 23 09-09-2008 08:57 AM
Can't change the color of the status bar mkroll iPhone SDK Development 2 08-06-2008 03:21 PM
UIColor with background view Senly iPhone SDK Development 3 04-22-2008 09:59 AM


» Advertisements
» Online Users: 261
20 members and 241 guests
2WeeksToGo, ADY, BrianSlick, dacapo, Dani77, Dattee, Duncan C, headkaze, IphoneSdk, jemicha, kapps11, mer10, mgon987, Punkjumper, sneaky, timle8n1
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,879
Threads: 89,228
Posts: 380,743
Top Poster: BrianSlick (7,129)
Welcome to our newest member, mgon987
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:40 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0