Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide backbar button in navigationbar in iPhone sdk

In my iPhone App there are three views, firstView, secondView and thirdView.

now I want to put Back Button in navigation bar in thirdView only which should take me to back secondView only

for that i m writing this code in first view

self.navigationItem.hidesBackButton:NO;

and it shows the back button in both the views secondView and thirdView

what I should do to hide back button in the the secondView?

like image 206
ios Avatar asked Dec 30 '10 04:12

ios


People also ask

How can hide back button in iOS?

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.

How do I customize the back button on my iPhone?

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.

How do I show the back button in Swift?

Back-button text is taken from parent view-controller's navigation item title. So whatever you set on previous view-controller's navigation item title, will be shown on current view controller's back button text. You can just put "" as navigation item title in parent view-controller's viewWillAppear method.


1 Answers

I think you have to set [self.navigationItem setHidesBackButton:YES] in your secondView. And set [self.navigationItem setHidesBackButton:NO] in your thirdView.

like image 189
EmptyStack Avatar answered Oct 31 '22 16:10

EmptyStack