如何防止弹出窗口隐藏在iOS6中的状态栏

时间:2013-12-16 10:53:40

标签: ios objective-c uipopovercontroller

我有一个popover,它来自代码:

    CGPoint screenPoint = [self.mapView screenPoint: self.selectedObject.pointCoordinate];
    CGRect rect = CGRectMake(screenPoint.x, screenPoint.y, 1, 1);
    [self.detailViewPopover presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

正如你在屏幕截图中看到的那样 - 弹出窗口隐藏在状态栏中 - 是否可以从应该显示popover的区域中排除状态栏框架?

popover中视图的内容大小如下所示:

self.contentSizeForViewInPopover = CGSizeMake (320, self.view.frame.size.height - 100);

enter image description here

1 个答案:

答案 0 :(得分:3)

您将UIPopoverArrowDirectionUp重置为UIPopoverArrowDirectionAny

  [self.listViewPopover presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];