6

I'm presenting a list of options to the user using an UIAlertController from a UIToolbar with a preferred style of action sheet. When presented, the popover's arrow is cut off and its corners are rounded with two different radii:

Deformed UIAlertController popover

The code I'm using to present it is straight from the documentation, as far as I see it:

UIAlertController *alertController =
    [UIAlertController alertControllerWithTitle:@""
                                        message:@""
                                 preferredStyle:UIAlertControllerStyleActionSheet];
NSArray *actions = @[
    [UIAlertAction actionWithTitle:@"Take a Photo"
                             style:UIAlertActionStyleDefault
                           handler:^(UIAlertAction *action) {}],
    [UIAlertAction actionWithTitle:@"Choose from Album"
                             style:UIAlertActionStyleDefault
                           handler:^(UIAlertAction *action) {}],
    [UIAlertAction actionWithTitle:@"Cancel"
                             style:UIAlertActionStyleCancel
                           handler:^(UIAlertAction *action) {}]
];
for (UIAlertAction *action in actions) {
    [alertController addAction:action];
}

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    alertController.modalPresentationStyle = UIModalPresentationPopover;
    alertController.popoverPresentationController.barButtonItem = myBarButtonItem;
}
[self presentViewController:alertController animated:YES completion:nil];

Is this a known bug? I've tried a physical iPad on iOS 8.2 and the simulator on iOS 8.1 and 8.2.

Adrian
  • 1,842
  • 13
  • 25

1 Answers1

0

Try explicitly setting the permittedArrowDirections.

For example in Swift:

actionSheet.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.Down;
Ajean
  • 5,528
  • 14
  • 46
  • 69
  • I was actually able to reproduce your issue and it occurred after I changed orientation of the device and then switched back to the original orientation. – Alexis Candelaria Sep 13 '16 at 16:04