UIPopoverController 锚点位置
我有一个 UIPopOverController,其内容控制器是 UINavigationController。 我正在根据推入/弹出的控制器的内容大小调整弹出窗口的大小。最初,我使用方法 presentPopoverFromRect:inView:permissedArrowDirections:animated:
来呈现弹出窗口。锚点位置指向我作为参数传递的矩形的中心。如果我将一个控制器(其内容大小很小)推入 navigationController ,弹出窗口会从底部缩小并移动到我之前提到的矩形上方。
我尝试每次都呈现弹出窗口(对于推送/弹出),锚点位置保持@同一点,但动画受到影响,看起来不太好。
无论弹出窗口大小变化如何变化,需要做什么才能使锚点位置保持不变?
I have a UIPopOverController for which the content controller is a UINavigationController.
I'm resizing the popover size according to the content size of the controller pushed/popped into it. Initally i'm presenting the popover by using the method presentPopoverFromRect:inView:permittedArrowDirections:animated:
. The anchor position is pointing at the center of the rect which i passed as an argument. If i push a controller(whose content size is small) into the navigationController , the popover shrinks from the bottom and moves above the rect which i mentioned earlier.
I tried to present the popover everytime(for push/pop) , anchor position remains @ same point But the animation gets affected , doesnt looks good.
what needs to be done to make the anchor position remains same irrespective of the change in popover size variation ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,似乎再次调用
presentPopoverFromRect
方法将使锚点保持在相同的位置,例如
希望它也适用于你的情况
I've encountered the same issue and it seems that calling the
presentPopoverFromRect
method again will keep the anchor at the same positione.g.
Hope it works in your case as well
呈现 UIPopoverController 后更改框架:
Change frame after presenting UIPopoverController: