【问题标题】:How to dismiss popovers in iOS 5?如何在 iOS 5 中消除弹出窗口?
【发布时间】:2012-03-04 11:06:26
【问题描述】:

我在 iPad 的主控端有一个 PatientTableViewController,它有一个用于添加新患者的按钮。它通过 popover segue 转换到这个 NewPatientViewController

NewPatientViewController 中,我有一个 Done 按钮,它代表 PatientTableViewController

- (void)newPatientViewController:(NewPatientViewController *)sender withZipCode:(NSNumber *)zipCode andFirstName:(NSString *)firstName andLastName:(NSString *)lastName
{
    [self dismissViewControllerAnimated:YES completion:NULL];
    [self dismissModalViewControllerAnimated:YES];
    [sender dismissModalViewControllerAnimated:YES];
    [sender dismissViewControllerAnimated:YES completion:NULL];
}

我上面尝试的方法都不起作用。但是,如果我使用模态转场,一切正常。瓦?

【问题讨论】:

    标签: objective-c xcode cocoa-touch ipad xcode4.2


    【解决方案1】:

    终于在this post的帮助下搞定了

    基本上,您需要有一个变量来跟踪 segue(您需要将其转换为 UIStoryboardPopoverSegue)和更多的怪异。

    我写了一个blog post 更详细地描述了解决方案。

    【讨论】:

      【解决方案2】:

      你在 UIPopoverController 类上尝试过dismissPopoverAnimated: 吗?

      【讨论】:

      • 谢谢伙计。我试过了,但不知道在哪个属性上调用它。我终于偶然发现了this post,它帮助我弄清楚了。
      • 我还没有使用故事板,所以我只是在黑暗中拍摄。
      猜你喜欢
      • 1970-01-01
      • 2011-09-30
      • 1970-01-01
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多