gpt4 book ai didi

ios - 导航标题未显示在 ResearchKit 中

转载 作者:搜寻专家 更新时间:2023-11-01 06:37:58 26 4
gpt4 key购买 nike

如何在 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";
}

关于ios - 导航标题未显示在 ResearchKit 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39169379/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com