Take the 2-minute tour ×

this is the code ,this will show the default size, i want to change the font size of the title becoz this title is too big n not showing the whole only "Cook Great Indian..." is showing...pl let me help out

- (void)viewDidLoad {

    self.title = @"Cook Great Indian Recipes";
share|improve this question
From xib's attribute inspector, you can achieve it eaisly. –  rptwsthi Aug 18 '11 at 7:29
add comment

2 Answers

up vote 11 down vote accepted

Try setting custom label for title label:

    self.title = @"Cook Great Indian Recipes";
    CGRect frame = CGRectMake(0, 0, [self.title sizeWithFont:[UIFont boldSystemFontOfSize:20.0]].width, 44);
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.backgroundColor = [UIColor clearColor];
    label.font = [UIFont boldSystemFontOfSize:17.0];
    label.textAlignment = UITextAlignmentCenter;
    self.navigationItem.titleView = label;
    label.text = self.title;
    [label release];
share|improve this answer
thnx dude this is working perfactly ..1c again thnx for giving with exmple .. –  Dev Singh Aug 18 '11 at 7:50
add comment

You can not change the font of title. Instead create a UILabel with your own customization and assign it as navigationItem's titleView.

UILabel *titleLbl = [[UILabel alloc] init];
label.frame = CGRectMake(...
label.font = [UIFont ...
// And the other things
self.navigationItem.titleView = titleLbl;
[titleLbl release];
share|improve this answer
thnx for ur response bt this isn't working ... –  Dev Singh Aug 18 '11 at 7:51
add comment

Your Answer


