Is it possible to present a popover without any sort of arrows pointing somewhere?
This works fine for me.
[popoverController presentPopoverFromRect:CGRectMake(0, 0, 20, 20)
inView:self.view
permittedArrowDirections:NULL
animated:YES];
Enjoy Coding.
In swift 3, you can build a UIPopoverArrowDirection
extension for this:
extension UIPopoverArrowDirection {
public static var noArrow: UIPopoverArrowDirection {
return UIPopoverArrowDirection(rawValue: 0)
}
}
and the you can do:
popoverPresentationController!.permittedArrowDirections = .noArrow
Do not use Popovers if you don't want to show arrows. Present your view controller as a Modal and use a UIModalPresentationFormSheet instead.
Example:
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MyStoryBoard" bundle:nil];
UIViewController* viewController = [sb instantiateViewControllerWithIdentifier:@"myViewController"];
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
[presenterViewController presentViewController: viewController animated:YES completion:^{
}];
Set the permittedArrowDirections
to 0.
permittedArrowDirections:0
Code -
[self.popoverController presentPopoverFromBarButtonItem:anItem
permittedArrowDirections:0
animated:YES];
Zero tells "NoDirection".
Swift4:
popover.permittedArrowDirections = []