How to hide the back button in UINavigationController?
I just found out the answer, in a controller use this:
[self.navigationItem setHidesBackButton:YES animated:YES];
And to restore it:
[self.navigationItem setHidesBackButton:NO animated:YES];
--
[UPDATE]
Swift 3.0:
self.navigationItem.setHidesBackButton(true, animated:true)
UINavigationBar Hide back Button Text
In the interface builder, you can select the navigation item of the previous controller and change the Back Button
string to what you'd like the back button to appear as. If you want it blank, for example, just put a space.
You can also change it with this line of code:
[self.navigationItem.backBarButtonItem setTitle:@"Title here"];
Or in Swift:
self.navigationItem.backBarButtonItem?.title = ""
Swift - How to hide back button in navigation item?
According to the documentation for UINavigationItem
:
self.navigationItem.setHidesBackButton(true, animated: true)
How can I hide the back arrow in the navigation bar's back button?
If you do ,
navigationController?.navigationBar.backIndicatorImage = nil
navigationController?.navigationBar.backIndicatorTransitionMaskImage = nil
or
navigationController?.navigationBar.backIndicatorImage = UIImage(named: "")
navigationController?.navigationBar.backIndicatorTransitionMaskImage = UIImage(named: "")
Then by default iOS use <
as default image.
To remove this image you need to add blank transparent image. I used sample from here and google image reference is here
Now reduce the image pixel size to (1,1)
and add in your assets and use below code.
navigationController?.navigationBar.backIndicatorImage = UIImage(named: "Blank")
navigationController?.navigationBar.backIndicatorTransitionMaskImage = UIImage(named: "Blank")
Here Blank is the same image name in my asset.
How to completely remove back button from navigation bar?
Note:Problem solved with just comment. But posting this as answer so that It will help someone else having same issue.
I too had same problem with navigationBarButtonItem
while adding custom barButtonItem
to navigationBar
in storyboard. If you are also using storyboard then just set navigationBar
tint color as clear color in navigationController
. By setting clear color, that weird default navigation back button will not appear anymore.
Related Topics
How to Pass Information Between Storyboard Segues
How to Scroll to a Particluar Index in Collection View in Swift
Invalid Signature (Invalid Binary) on Itunes Connect
Determine User's "Temperature Unit" Setting on iOS 10 (Celsius/Fahrenheit)
Differentiate Between Screen Lock and Home Button Press on iOS7
How to Disable iPhone 6 Native Resolution
Swift iOS9 New Contacts Framework - How to Retrieve Only Cncontact That Has a Valid Email Address
Get Error Code -11843 While Exporting Mp3 File in Ipod Library Since iOS 5.1
How to Detect iOS 6 and All Minor Versions by User Agent
How to Share Nsdata or Phasset Video Using Facebook iOS Sdk 4.0 Fbsdksharedialog
How to Display the Emoji and Special Characters in Uilabel and Uitextviews
Add Rounded Corners to All Uiimageviews
Watchkit Extension Bundle Identifiers
iOS Multiline Label in Interface Builder
Intercept Objective-C Delegate Messages Within a Subclass