【问题标题】:iOS 5.1.1 Popover not dismissing automaticallyiOS 5.1.1 Popover 不会自动关闭
【发布时间】:2012-06-01 11:40:32
【问题描述】:

我的应用程序在旧操作系统上运行良好,但在 5.1.1(在 iPad2 和新 iPad 上测试)弹出窗口显示,运行良好但当用户在弹出窗口外点击时不会关闭。我不使用任何解雇代码或按钮。我使用 iOS 5.0 SDK、XCode 4.2 来编译应用程序。这就是我展示它的方式。有什么想法可能是错的吗?

- (void)showNotifications {

    NotificationsViewController *vc = [[[NotificationsViewController alloc] init] autorelease];
    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    if ([UIApplication isIPad]) {

        vc.modalInPopover = YES;
        self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:vc] autorelease];

        [self.popoverController presentPopoverFromRect:bottomView.frame inView:[bottomView superview] permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];

    }
    else
        [self presentModalViewController:vc animated:YES];

}

【问题讨论】:

    标签: ios ipad viewcontroller popover


    【解决方案1】:

    谜团解开了。刚刚注释掉了这一行

    //vc.modalInPopover = YES; must be no on iOS 5
    

    ModalInPopover 在 iOS 5 上必须为 false。不知道它是否仍然适用于 iOS 4。

    【讨论】:

      猜你喜欢
      • 2022-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      相关资源
      最近更新 更多