我有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
from 。UIPopoverPresentationControllerDelegate
这里出了什么问题,有什么建议吗?
提前致谢!