在watchkit上使用segue时如何删除“取消”按钮?

时间:2018-07-08 04:30:14

标签: segue watchkit

我想实现以下功能。
1,从表对象中单击一个。
2,显示基于页面的界面控制器,左上角没有“取消”按钮。

我认为此功能是在Apple健身应用中实现的。
换句话说,您选择一种锻炼方式,例如从表对象运行,然后将页面移动到基于页面的界面控制器,而无需在左上角单击取消按钮。 我想知道如何实现它。

这是我的代码:

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: 
Int) 
{  
    presentController(withNames: ["left", "Main", "Right"], contexts: [rowIndex])  
}

但是,“取消”按钮仍然存在。

请教我如何执行此操作。 预先感谢。

1 个答案:

答案 0 :(得分:0)

如果使用此方法,您将获得所需的页面,而顶部没有“取消”按钮。 WKInterfaceController.reloadRootControllersWithNames(["NewInterfaceController"], contexts: ["NewInterfaceController"])

将“新接口控制器”替换为您要显示的接口控制器的名称。

相关问题