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