我已经做了一个包含11个步骤的ResearchKit调查,但我想删除每个问题底部的默认取消按钮。
我遇到了这个命令:
stepViewController.cancelButtonItem = nil;但是我好像找不到合适的地方放它。
谢谢。
发布于 2019-06-27 02:42:12
正确的位置应该在委托回调中。文档声明“cancel按钮项在视图加载期间和step属性值更改时更新,但在taskViewController:stepViewControllerWillAppear:委托回调中设置是安全的。”
举个例子:
func taskViewController(_ taskViewController: ORKTaskViewController, stepViewControllerWillAppear stepViewController: ORKStepViewController) {
stepViewController.cancelButtonItem = nil
}这就是说,根据他们的repo上的这些问题,该功能目前似乎在ResearchKit的最新版本中被破坏了。
https://github.com/ResearchKit/ResearchKit/issues/1273
它当前将禁用取消按钮的功能,但不能正确地从ORKNavigationContainer中删除该按钮。如果你找到了解决方案,请让我知道,这个问题已经在他们的repo和其他一些地方发布了一段时间,但没有运气。
https://stackoverflow.com/questions/56778034
复制相似问题