UIAlertController从UIBarButtonItem呈现,旋转后位置错误

时间:2014-09-26 14:35:39

标签: ios8 uialertcontroller

我有一些UIToolBar有一些按钮。我通过此按钮向UIAlertController提供UIAlertControllerStyleActionSheet演示文稿样式。它显示正确,但是当我旋转设备时,此操作表有错误的位置。

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction* destructive = [UIAlertAction actionWithTitle:destructiveTitle style:UIAlertActionStyleDestructive handler:someHandler];
[alertController addAction:destructive];

[alertController setModalPresentationStyle:UIModalPresentationPopover];
alertController.modalInPopover = YES;

alertController.popoverPresentationController.barButtonItem = barButton;

alertController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;

alertController.popoverPresentationController.delegate = self;

[self presentViewController:alertController animated:YES completion:nil];

此处还有一件事,我在转动设备时未调用来自popoverPresentationController:willRepositionPopoverToRect的{​​{1}}。

这里出了什么问题,有什么建议吗?

提前致谢!

0 个答案:

没有答案