Home > Net >  hide back button title on navigation bar not working for iOS 13 and above
hide back button title on navigation bar not working for iOS 13 and above

Time:02-17

I have added the following code to hide the back button title on the navigation bar but it is not working on iOS 15.

UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: -1000, vertical: 0),
                                                                      for: UIBarMetrics.default)

can someone help me plz?

CodePudding user response:

You will want to do this on your navigation bar button:

 navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)

The title will need to be an empty string and that gets rid of the title.

CodePudding user response:

I have resolve this by using following method :

let appearance = UINavigationBarAppearance()    
appearance.backButtonAppearance.normal.titlePositionAdjustment = UIOffset(horizontal: -1000, vertical: 0)
  • Related