Hello. I'm diving into iOS development and I'm programmatically creating some labels, but I can't seem to set their background color to black. From what I read, it seems simple enough, here's my code...
UILabel *lbl = [[[UILabel alloc] initWithFrame:CGRectMake(x, y, width, height] autorelease];
[[lbl layer] setBorderColor:[[UIColor blackColor] CGColor]];
[[lbl layer] setBorderWidth:1.0];
[[lbl layer] setBackgroundColor:[[UIColor blackColor] CGColor]];
[[self view] addSubview:lbl];
When I do this, the border color and width work as expected, but the background color remains white. Am I forgetting to do something?
Thanks so much for your help!