如何在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”。
答案 0 :(得分:3)
您需要执行两个步骤:
1)关闭进度标题:
taskViewController.showsProgressInNavigationBar = NO;
2)为delegate
实施并设置ORKTaskViewController
:
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController {
stepViewController.title = @"Your title";
}