我有一个iPad应用程序,我在其中显示一个UIPopover
视图。我想根据弹窗在屏幕上的位置设置它的背景。是否有可能得到UIPopover
相对于屏幕的确切位置?
try this
if ([myPopOverController isPopoverVisible]) {
CGPoint myPopOverPosition = [myPopOverController.contentViewController.view
convertPoint:myPopOverController.contentViewController.view.frame.origin
toView:mainTopView];
//If you set toView to nil then it will consider as the window or you could specify as yourappDelegate.window
}