UIPopoverViewController 没有返回到原来的位置

发布于 2024-11-18 05:15:45 字数 957 浏览 4 评论 0原文

我遇到了 iPad 的 UIPopoverViewController 的问题,一旦 UITextField 成为第一响应者并且键盘弹出,Popover 就会移动到另一个位置,但是如果键盘被关闭并且 iPad 的位置为向左横向,Popover 不会回到原来的位置。我做了相当多的研究,这里也​​有一些关于它的解释: UIPopoverController 在键盘滑回后不移动到原始位置

问题是我无法关闭弹出窗口并再次检索它,我知道这可能是一种解决方法,但我们团队正在开发的主要项目无法做到这一点。

一些图像显示了该行为:

它在横向右侧的表现如何:

从按钮弹出:

显示键盘:

返回其位置:

左侧景观效果不佳:

<一个href="https://i.sstatic.net/IVx22.png" rel="nofollow noreferrer">

I have reached an issue with the UIPopoverViewController for iPad that once a UITextField becomes first responder and the keyboard pops up, the Popover moves to another place, however if the keyboard is dismissed and the position of the iPad is Landscape Left, the Popover doesn't come back to its original place. I had made quite a reseach, also here is few explanations about it: UIPopoverController not moving to original position after keyboard slides back down

The main problem is that I can't dismiss the popover and retrieve it again, I know this could be a work around but the main project that our team is working on is not feasible to do that.

And few images showing the behavior:

How it does on Landscape right:

Pop up from the button:

Showing up the keyboard:

Returning to its place:

Landscape left doesn't come back well:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别把无礼当个性 2024-11-25 05:15:45

您可以使用:

- (void)presentPopoverFromRect:rect inView:view permittedArrowDirections:arrowDirections animated:animated

在单独的 UIView 中呈现弹出窗口,其唯一目的是移动弹出窗口。然后订阅 UIKeyboardWillShowNotification 和 UIKeyboardWillHideNotification 来为 UIView 制作动画,这也应该移动弹出窗口。

You may be able to use:

- (void)presentPopoverFromRect:rect inView:view permittedArrowDirections:arrowDirections animated:animated

to present the popup in a separate UIView who's sole purpose will be to move the popover around. then subscribe to the UIKeyboardWillShowNotification and UIKeyboardWillHideNotification to animate that UIView, which should move the popover as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文