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.
While you are pushing 2nd controller from 1st controller, put self. navigationItem. title = "" in viewWillDisappear of 1st controller. It hides back button title from 2nd controller.
Change The Back Button Title In The Previous View Controller You can also just set the title of the previous view controller and iOS will automatically set that to the back button of the view controller. Now on the next view controller that push on the navigation stack, it will have this title as its back button.
Check that you have the latest version of iOS on your iPhone 8 or later. Go to Settings > Accessibility > Touch, and tap Back Tap. Tap Double Tap or Triple Tap and choose an action. Double or triple tap on the back of your iPhone to trigger the action you set.
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 :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With