Re: UIPopover arrow not centered on source frame
Re: UIPopover arrow not centered on source frame
- Subject: Re: UIPopover arrow not centered on source frame
- From: Fritz Anderson <email@hidden>
- Date: Thu, 14 Nov 2013 11:22:05 -0600
On 13 Nov 2013, at 11:28 PM, Rick Mann <email@hidden> wrote:
> I use a storyboard segue to present this popover, but it's not centered on the button:
>
> http://cl.ly/image/1S153u1a1I3O
>
> Any idea what's wrong? TIA,
[Shows something that looks like a gray gear-icon UIBarButtonItem in a UIToolbar at the top of (guessing, and if it matters) the detail part of an iPad UISplitViewController. Toolbar is flush at the bottom of the status bar. iOS 7 presentation. A popover descends from an X location that is close to, probably exactly at, the trailing edge of the button. Y location at or close to the bottom of the button.]
More information would be helpful.
Is that gear button actually a UIBarButtonItem? And are you using presentPopoverFromBarButtonItem:…?
If not, is the area that visually contains the button a UIToolbar?
Is the area that visually contains the button object its actual superview (moot in the case of bar items, because they don't have superviews, or frames, or bounds)?
If it's not a bar item, is there anything funny about how it draws its content; specifically, is the icon drawn off-center in the bounds? Is there any applicable justification/alignment property?
If you are using an actual button, or other object that is a view, and therefore not a bar item, and therefore are using presentPopoverFromRect:inView:…, are you using the object's frame, and not bounds?
[View, not bar item] Are you passing the actual, and not the visual, superview? Have you verified it by breaking at the call site and examining what you're passing? While you're at that breakpoint, have you examined the rect?
If you're using …FromRect:…, are you (or whatever is giving it to you) offsetting the rect by half its width? Not easy to imagine why, but if the workings of the code were easy to imagine, you wouldn't have a bug.
[Bizarre] Are there any affine transforms on the button object (must be a view) or its superview?
Most of these questions are dead ends, depending on the answers of the precedent ones, but the interaction on mailing lists and fora has latency problems.
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden