views:

22

answers:

1

Hi,

I'm trying to place a UIPopoverController to display when a UIButton is tapped. However, the UIButton is placed within a UIScrollView and so its frame is offset by the scroll amount.

Is there an easy way of finding out a view's frame as it appears in the context of the screen? Or do I just need to do a subtraction between the UIButton frame and the contentOffset of the UIScrollView?

Thanks!

+2  A: 

If you are using - (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated then you are already specifying the view that you are wanting to present from. Just present the popover from 0,0 0,0 in your UIButton.

MattLeff
I did something very similar but thanks... I presented from the UIButton's rect and used the UIScrollView as the "inView"... :)
Joe