Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIPopoverController模式问题_Iphone_Ios_Uipopovercontroller_Presentmodalviewcontroller_Uipopover - Fatal编程技术网

Iphone UIPopoverController模式问题

Iphone UIPopoverController模式问题,iphone,ios,uipopovercontroller,presentmodalviewcontroller,uipopover,Iphone,Ios,Uipopovercontroller,Presentmodalviewcontroller,Uipopover,我有一个超控器 UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:loginVC] autorelease]; navVC.modalInPopover = YES; navVC.modalPresentationStyle = UIModalPresentationCurrentContext; _popoverLo

我有一个超控器

    UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:loginVC] autorelease];

    navVC.modalInPopover = YES;
    navVC.modalPresentationStyle = UIModalPresentationCurrentContext;    


    _popoverLoginVC = [[UIPopoverController alloc] initWithContentViewController:navVC];
当我展示府绸时

  [self.popoverLoginVC presentPopoverFromRect:centerFrame
                                     inView:self.splitVC.view
                   permittedArrowDirections:0 
                                   animated:YES];
看起来这是模态,我不能通过点击外面来关闭popover,但其他区域并没有变暗。 我玩过modalPresentationStyle,运气不好


请告知它是模态的,因为您正在将它设置为模态

navVC.modalInPopover = YES;
只要删除该行,如果我理解正确,您就可以了。

删除该行

navVC.modalInPopover=是

navVC.modalPresentationStyle=UIModalPresentationCurrentContext


popover并不意味着,也不能指定为使“背景”视图变暗,即使是以模式显示

permittedArrowDirections:0
这不是此参数的有效值,至少在iOS>=6中会导致未定义的行为。必须指定以下选项之一:

UIPopoverArrowDirectionUp = 1UL << 0,
UIPopoverArrowDirectionDown = 1UL << 1,
UIPopoverArrowDirectionLeft = 1UL << 2,
UIPopoverArrowDirectionRight = 1UL << 3,
UIPopoverArrowDirectionAny = UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown | UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight,

遗憾的是,不支持“无箭头”选项:

所以我需要得到屏幕截图这样的结果,为什么你省略了presentPopoverFromRect的代码?它可能是解决你的问题的关键。不,我需要模态,但其他区域应该变暗。不,我需要模态。问题是-其他区域未变暗在视图上添加popover时更改主视图的alpha。在iOS7中,它们实际上会自动进行更改:popover内容分层在现有内容的顶部,背景会自动变暗。