我有一个UIScrollView,其中内容大小大于框架。我正在显示UIPopoverController,并希望使用UIImageView的框架来调用设置popover的放置位置:
[popoverController presentPopoverFromRect: imageView.frame inView: self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
有没有办法把这个位置映射到正确的位置?
- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view
比如:
CGRect convertedFrame = [scrollView convertRect:imageView.frame toView:self.view]; [popoverController presentPopoverFromRect:convertedFrame inView: self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];