Reputation: 2923
I have a problem and can't solve it. I'll try to describe the issue, so:
when the title of the UINavigationBar
is not so long - the situation is like this:
but if the title of the bar contains more characters - it hides the title of the back button as u can see on the next screenshot:
Is it a standard UINavigationBar
behaviour in iOS7? May be there are some ways to solve this? Anyway in iOS6
the situation is much better - there I can't find any problem like this.
Upvotes: 5
Views: 1527
Reputation: 4614
Simple fix:
Create one view with label and set that view as a title view to the navigation controller
// creating title view
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
// Adding label with custom frame
UILabel *labelForTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
[labelForTitle setCenter:titleView.center];
[labelForTitle setText:@"sfdfagd ggjhdgfjhadsgfjasgdhfgasdjfgajsdgfjashgdjhfasjdfsadjgfhsadghf"];
[titleView addSubview:labelForTitle];
// setting title view for the navigation controller.
[self.navigationItem setTitleView:titleView];
output will be like this :
Upvotes: 7