首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FPPopover不显示弹出视图iOS 6

FPPopover不显示弹出视图iOS 6
EN

Stack Overflow用户
提问于 2012-11-27 17:06:30
回答 1查看 827关注 0票数 1

我正在尝试使用FPPopover打开通知视图,它可以在应用程序上的iOS 5上运行,但不会在iOS 6上显示。但是,如果我对不同的项目使用相同的代码来执行此操作,它确实会在iOS 5和6上显示

这就是我在这两个项目中所做的。

代码语言:javascript
复制
- (IBAction)NotificationButtonPressed:(id)sender {
    [self openNotificationsPopOver:sender];
}

- (void)openNotificationsPopOver:(id)sender {
    [self setNotificationCount:0];

    NotificationViewController *vc = [[UIStoryboard storyboardWithName:@"Notification" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"NotificationViewController"];

//    NotificationViewController *vc = [[NotificationViewController alloc]init];
//    [vc setParentViewController:self];


    FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:vc];

    //sender is the UIButton view
    [popover presentPopoverFromView:sender];

    //popover.arrowDirection = FPPopoverArrowDirectionAny;
    popover.tint = FPPopoverDefaultTint;

    popover.contentSize = CGSizeMake(200, 250);

    popover.arrowDirection = FPPopoverArrowDirectionAny;
    NSLog(@"Present popover");
    //sender is the UIButton view
    [popover presentPopoverFromView:sender];
//    [popover presentPopoverFromPoint:CGPointMake(160, 0)];

//sender is the UIButton view
//    [popover presentPopoverFromView:self.navigationController.navigationBar];
}

我也尝试使用为它注释掉的代码行……所有方法都适用于单独的项目(iOS 5和6),但仅适用于主项目( iOS 5

我还尝试了删除框架并重新添加它们。从xCode 4.3开始这个项目(不知道这是否重要)。

参考:https://github.com/50pixels/FPPopover

EN

回答 1

Stack Overflow用户

发布于 2013-03-24 09:36:53

你需要确保“窗口”在alloc和呈现弹出窗口之前被实例化。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13580646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档