【问题标题】:Navigation title not showing up in ResearchKit导航标题未显示在 ResearchKit 中
【发布时间】:2017-01-03 07:24:01
【问题描述】:

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

【问题讨论】:

    标签: ios swift researchkit


    【解决方案1】:

    您需要执行两个步骤:

    1) 关闭进度标题:

    taskViewController.showsProgressInNavigationBar = NO;
    

    2) 为ORKTaskViewController 实现并设置delegate

    - (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController {
        stepViewController.title = @"Your title";
    }
    

    【讨论】:

      猜你喜欢
      • 2018-04-23
      • 2020-03-15
      • 2021-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多