How can I remove the "<" from the UINavigationItem Back Button. I have a UIViewController on my storyboard that's opened with a Push segue. I'd like to just have the text on the back button, and not the back arrow.
So far, I added this code to the prepareForSegue function in the calling UITableViewController.
let backItem = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle., target: nil, action: nil)
navigationItem.backBarButtonItem = backItem
When the UIView comes up, it has "< Done" in the text of the back button. How can I set it up so that it just has "Done"?
The . navigationBarBackButtonHidden(true) will hide the back button.
Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
Add this 2 line of code in your appdelegate. It will remove back indicator from all the view controllers.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
UINavigationBar.appearance().backIndicatorImage = UIImage()
UINavigationBar.appearance().backIndicatorTransitionMaskImage = UIImage()
}
If you are getting space in left side then set title position
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(-20, 0), for: UIBarMetrics.default)
In viewDidLoad
self.navigationItem.setHidesBackButton(true, animated: false)
If you have a custom UINavigationBar
set leftBarButtonItem
to nil
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