Objective C: Change title font in navigation bar

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 30)];
label.textAlignment = UITextAlignmentCenter;
label.adjustsFontSizeToFitWidth = YES;
label.minimumFontSize = 10.0;
[label setFont:[UIFont boldSystemFontOfSize:16.0]];
[label setBackgroundColor:[UIColor clearColor]];
[label setTextColor:[UIColor whiteColor]];
[label setText:@"My Favorite Title"];

[self.navigationItem setTitleView:label];
[label release];

2 comments:

  1. I love your blog. Keep it up.Visit my site too.

    n8fan.net

    www.n8fan.net

    ReplyDelete
  2. I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very
    useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.


    edupdf.org

    ReplyDelete