【问题标题】:UIPopover get exact position on screen弹出框在屏幕上获得准确位置
【发布时间】:2014-08-07 01:53:18
【问题描述】:

我有一个 iPad 应用程序,其中显示了 UIPopover 视图。我想根据它在屏幕上的位置设置弹出框的背景。是否可以获得UIPopover相对于屏幕的确切位置?

【问题讨论】:

    标签: ios ipad uipopovercontroller uipopover uipopoverbackgroundview


    【解决方案1】:

    试试这个

        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
    
    
        }
    

    【讨论】:

      猜你喜欢
      • 2020-08-10
      • 1970-01-01
      • 1970-01-01
      • 2013-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-31
      相关资源
      最近更新 更多