移动UIPopoverPresentationController

时间:2014-09-27 00:55:21

标签: ios objective-c ios8 uipopovercontroller

任何人都知道如何在iOS 8的新UIPopoverPresentationController显示时移动它?这是我用来创建它的代码:

UIViewController *viewControllerForPopover = [[UIViewController alloc] init];
viewControllerForPopover.view = myView;
viewControllerForPopover.modalPresentationStyle = UIModalPresentationPopover;
viewControllerForPopover.preferredContentSize = myView.frame.size;
[self presentViewController:viewControllerForPopover animated:YES completion:nil];

myPopoverController = [viewControllerForPopover popoverPresentationController];
myPopoverController.permittedArrowDirections = UIPopoverArrowDirectionDown;
myPopoverController.sourceView = self.view;
myPopoverController.backgroundColor = [UIColor lightGrayColor];
rect = CGRectMake(10, 10, 10, 10);
myPopoverController.sourceRect = rect;

但是现在如何在仍然显示时移动它?使用旧UIPopoverController我刚调用presentPopoverFromRect将控制器移动到新坐标,但我无法找到UIPopoverPresentationController的解决方案。有什么想法吗?

0 个答案:

没有答案