UIPopoverPresentationController : ActionSheet position at barButtonItem (iPad)
Asked Answered
A

0

7

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

I am doing the following:

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

Unfortunately the position of the popover (in relation to the UIBarButton) is not so nice and if I rotate the device the popover is not repositioned:

Corner not centered: enter image description here

After rotate: enter image description here

Airhead answered 18/3, 2015 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.