user1118019
user1118019

Reputation: 3959

change arrow placement in UIPopoverController

i have a UIPopoverController however, due to design, i must place the arrow differently. Again, this is arrow PLACEMENT, NOT ARROW DIRECTION

in other words, by default, the arrow is placed at the centre of the UIPopoverController like the follow:

 -----^-----
 |         |
 |         |
 |         |
 |_________|

i would like the following for my arrow placement

 --^--------
 |         |
 |         |
 |         |
 |_________|

is this possible?

Thanks

Upvotes: 3

Views: 3740

Answers (2)

mohamede1945
mohamede1945

Reputation: 7198

Try to use popoverLayoutMargins and set the left margin as you need.

Upvotes: 1

CrimsonDiego
CrimsonDiego

Reputation: 3616

The arrow actually points towards the rect that you provide in:

presentPopoverFromRect:inView:permittedArrowDirections:animated:

It appears in the center because the popover view tries to appear center-aligned with that provided rectangle. If you present the popover with that rect in a difficult-to-appear place such as a corner of the screen, it will get as close as it can, but won't necessarily be centered.

Unfortunately, you can't really change this behavior as it is internalized in the class, in order to preserve Apple/Cocoa UI guidelines and behavior.

Upvotes: 5

Related Questions