I have an application with a navigation bar that pushes to a login screen view controller and then pushes to a main menu. Is there any way I can remove the back button off the main menu, so the user is unable to go back to the login screen?
Thanks!
EDIT: Using Xcode 4.3 and doing all the leg work programmatically.
Yes, the back button can be disabled. Please navigate to Advanced Website Kiosk Settings–>Navigation–>Disable back button. Kindly enable this restriction to disallow the usage of the back button on the iOS device.
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.
The . navigationBarBackButtonHidden(true) will hide the back button.
You can do:
[self.navigationItem setHidesBackButton:YES];
In your second view controller (the one you want to hide the button in).
Peters answer is correct, although I think the better question is why? In a schema like yours where you are wanting to login a user, instead of using a Pushed VC, present a Modal VC and use a delegate method to get back the userinfo that was obtained in the Login process. I can post a complete code example if you need it, but it sounds like you have the details worked out with your login process. Just use:
presentModalViewController
instead of:
pushViewController
That way, you don't have to worry about the navigation stack and doing something that isn't really in-line with the user interface guidelines.
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