Search code examples
iosipaduipopovercontrolleruipopover

Why my UIPopoverController is popping in this way?


I've two buttons on iPad that opens two popups. They are opened with the code:

CGRect frame = [self.view convertRect:self.addNewFolderButton.frame fromView:self.addNewFolderButton.superview];
    [self.popover presentPopoverFromRect:frame
                                  inView:self.view
                permittedArrowDirections:UIPopoverArrowDirectionAny
                                animated:YES];

and

CGRect frame = [self.view convertRect:self.addNewUserButton.frame fromView:self.addNewUserButton.superview];
    [self.popover presentPopoverFromRect:frame
                                  inView:self.view
                permittedArrowDirections:UIPopoverArrowDirectionAny
                                animated:YES];

but my popView isn't opened in the same kind of way (the link with the calling button in positioned in different way. Why?

enter image description here

enter image description here


Solution

  • Because you are giving the arrow direction UIPopoverArrowDirectionAny which mean it could be any, set the specific direction for homogeneous behaviour