I'm trying to to hide navigation bar back button on an Apple Watch. There are a lot of questions for similar to mine but they are for iPhone and if you are know a little about Apple Watch there are InterfaceController instead of ViewController.
So when I push a new InterfaceController using the code below:
[self pushControllerWithName:@"about" context:nil];
It shows a back button on the navigation bar above and it takes it back to the previous InterfaceController from which it is generated.
Anyone have any idea how to hide or remove navigation bar or this back button from Apple Watch?
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 navigation bar is pinned by default. If you want to view files or use apps in full screen, double-tap the Show and hide button to hide the navigation bar.
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.
I had the same problem and solved it using :
NSMutableArray* controllerNames = [NSMutableArray new];
[controllerNames addObject:@"myInterfaceController"];
[WKInterfaceController reloadRootControllersWithNames:controllerNames contexts:myArrayOfData];
When the ICs are reloaded then they don't have navigation back buttons as they are the main IC.
Note
This method actually change your Initial Controller
( Main Interface Controller with arrow in storyboard.) of your watch app, that is the reason the Interface Controller
does not have back button.
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