UIPopoverPresentationController: ActionSheet position in barButtonItem (iPad)

I have a UIAlertController ( UIAlertControllerStyleActionSheet ) on the iPhone, which should now be presented in the UIPopoverPresentationController on the iPad version.

I do the following:

 UIPopoverPresentationController *popover = sectionActionSheet.popoverPresentationController; if (popover){ popover.sourceView = self.view; popover.barButtonItem = menuButton; popover.permittedArrowDirections = UIPopoverArrowDirectionAny; } 

Unfortunately, the position of the popover (relative to the UIBarButton) is not so good, and if I rotate the device, the popover does not move:

The angle is not centered: enter image description here

After turning: enter image description here

+6
source share

Source: https://habr.com/ru/post/983984/


All Articles