How to hide the back button from the status bar on

2019-05-11 08:40发布

I want to hide the back button from my Apple Watch app from the status bar.

I used the programmable segue to navigate. But I want to to hide/disable the back button. Is it possible?

3条回答
甜甜的少女心
2楼-- · 2019-05-11 09:02

You can present an interface controller modally using the method presentControllerWithName. Then, in the interface controller called, just set the title with the method setTitle.

查看更多
叼着烟拽天下
3楼-- · 2019-05-11 09:11

This is how you do it:

WKInterfaceController.reloadRootControllersWithNames(
     ["myInterfaceController"], contexts: []
)

Where myInterfaceController is the identifier of the destination Interface Controller.

Thanks to Harvant for the pointer.

查看更多
手持菜刀,她持情操
4楼-- · 2019-05-11 09:15

If you check the docs for WKInterfaceController, you'll see there's no API to accomplish what you're looking for: https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceController_class/

The best you can do is change the text of the title/button or adjust the tint color.

查看更多
登录 后发表回答