UIPopoverViewController 没有返回到原来的位置
我遇到了 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用:
在单独的 UIView 中呈现弹出窗口,其唯一目的是移动弹出窗口。然后订阅 UIKeyboardWillShowNotification 和 UIKeyboardWillHideNotification 来为 UIView 制作动画,这也应该移动弹出窗口。
You may be able to use:
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.