4

Using the following post, I was able to add a UILabel to a UIToolbar, however, it looks crappy. Anyone know how to get the text size / color / shadow to match the title for a UINavigationController?

Navigation Controller

alt text http://www.codingwithoutcomments.com/uploads/Picture1.png

UIToolbar with UILabel

alt text http://www.codingwithoutcomments.com/uploads/Picture2.png

What steps do I need to take to make them match?

Community
  • 1
  • 1
CodingWithoutComments
  • 35,598
  • 21
  • 73
  • 86

3 Answers3

7

You might also want to add a shadow?

itemLabel.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
itemLabel.shadowOffset = CGSizeMake(0, -1.0);
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
3

Obviously the question is about iPhone, but in case anyone is wondering, here are the numbers for iPad:

    titleLabel.font = [UIFont boldSystemFontOfSize:20.0];
    titleLabel.shadowOffset = CGSizeMake(0, 1);
    titleLabel.shadowColor = [UIColor colorWithWhite:1.f alpha:.5f];
    titleLabel.textColor = [UIColor colorWithRed:113.f/255.f green:120.f/255.f blue:127.f/255.f alpha:1.f];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.text = @"Title";
Alexey
  • 7,262
  • 4
  • 48
  • 68
0
UILabel * itemLabel = [[UILabel alloc] initWithFrame:rectArea];
itemLabel.text = @"Item";   
itemLabel.textColor = [UIColor whiteColor];
itemLabel.font = [UIFont boldSystemFontOfSize:22.0];
CodingWithoutComments
  • 35,598
  • 21
  • 73
  • 86