Navigation title gets hidden by bar button
In my 开发者_StackOverflow中文版app when I'm setting the title more than 13 characters it is hidden by bar button.So how do i overcome from this problem.Please help me.Thanks in advance.
Use a smaller font or a shorter title, or use a multiline title by customizing the navBar's titleView
with a custom UILabel
. For example,
// CUSTOMIZE NAVIGATION BAR TITLE LABEL
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
[label setBackgroundColor:[UIColor clearColor]];
[label setFont:[UIFont boldSystemFontOfSize:20.0]];
[label setAdjustsFontSizeToFitWidth:YES];
[label setTextAlignment:UITextAlignmentCenter];
[[self navigationItem] setTitleView:label];
[label release];
You can customize it however you like.
精彩评论