10

我有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:willRepositionPopoverToRectfrom 。UIPopoverPresentationControllerDelegate

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

提前致谢!

4

0 回答 0