导航标题未显示在 ResearchKit 中
Navigation title not showing up in ResearchKit
如何在 Research Kit 中显示 TaskViewController 的标题?我一直在尝试以下操作,但它似乎没有出现,尽管可以通过这种方式设置其他属性。
let taskViewController = ORKTaskViewController(task: ConsentTask, taskRunUUID: nil)
taskViewController.navigationBar.topItem!.title = "TITLE"
taskViewController.restorationIdentifier = "1"
taskViewController.delegate = self
presentViewController(taskViewController, animated: true, completion: nil)
我也试过了taskViewController.title = "TITLE".
您需要执行两个步骤:
1) 关闭进度标题:
taskViewController.showsProgressInNavigationBar = NO;
2) 为 ORKTaskViewController
实施并设置 delegate
:
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController {
stepViewController.title = @"Your title";
}
如何在 Research Kit 中显示 TaskViewController 的标题?我一直在尝试以下操作,但它似乎没有出现,尽管可以通过这种方式设置其他属性。
let taskViewController = ORKTaskViewController(task: ConsentTask, taskRunUUID: nil)
taskViewController.navigationBar.topItem!.title = "TITLE"
taskViewController.restorationIdentifier = "1"
taskViewController.delegate = self
presentViewController(taskViewController, animated: true, completion: nil)
我也试过了taskViewController.title = "TITLE".
您需要执行两个步骤:
1) 关闭进度标题:
taskViewController.showsProgressInNavigationBar = NO;
2) 为 ORKTaskViewController
实施并设置 delegate
:
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController {
stepViewController.title = @"Your title";
}