[英]How to remove 'cancel button' in a ResearchKit survey
我做了一個包含 11 個步驟的 ResearchKit 調查,但我想刪除每個問題底部的默認取消按鈕。
我遇到過這個命令:
stepViewController.cancelButtonItem = nil;
但我似乎找不到合適的地方。
謝謝。
正確的位置是在委托回調中。 文檔指出“取消按鈕項在視圖加載期間和step
屬性的值更改時更新,但在taskViewController:stepViewControllerWillAppear:
委托回調中設置是安全的。”
作為一個例子:
func taskViewController(_ taskViewController: ORKTaskViewController, stepViewControllerWillAppear stepViewController: ORKStepViewController) {
stepViewController.cancelButtonItem = nil
}
話雖如此,但根據其存儲庫中的這些問題,該功能目前似乎在最新版本的 ResearchKit 中被破壞了。
https://github.com/ResearchKit/ResearchKit/issues/1273
它當前將禁用取消按鈕的功能,但不會從 ORKNavigationContainer 中正確刪除按鈕。 如果您找到了解決方案,請告訴我,該問題已在他們的 repo 以及其他一些地方發布了一段時間,但沒有運氣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.