How to hide navigation bar back button?

后端 未结 4 933
借酒劲吻你
借酒劲吻你 2020-12-30 00:55

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 ab

4条回答
  •  清酒与你
    2020-12-30 01:32

    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.

提交回复
热议问题