【发布时间】:2014-07-27 00:20:04
【问题描述】:
如标题所示,在 iOS8 中,[UIPopoverController presentPopoverFromRect] 不再适用于 [UIApplication sharedApplication].keyWindow。 (它在 iOS7 中确实有效)
我验证了以下代码:
TestViewController *test = [[TestViewController alloc] initWithNibName:nil bundle:nil];
if (testPopoverController == nil) {
testPopoverController = [[UIPopoverController alloc] initWithContentViewController:test];
testPopoverController.popoverContentSize = CGSizeMake(250, 95*5);
}
CGPoint point = [sender convertPoint:CGPointMake(0, 0) toView:nil];
CGRect rect = CGRectMake(point.x, point.y, 24, 24);
[testPopoverController presentPopoverFromRect:rect inView:[UIApplication sharedApplication].keyWindow permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
【问题讨论】:
-
你想问的应该是在iOS 8中应该怎么做吧?
-
我也遇到了这个问题,有什么解决办法吗?
-
嘿...你得到这个答案了吗?
-
它最后对我有用..检查我的答案