gpt4 book ai didi

ios - UIPopover 获取屏幕上的确切位置

转载 作者:行者123 更新时间:2023-11-29 02:53:02 28 4
gpt4 key购买 nike

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

最佳答案

试试这个

    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


}

关于ios - UIPopover 获取屏幕上的确切位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24257253/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com