animation - 横向iPad上带有键盘的模态视图 Controller 在关闭时更改位置

标签 animation ipad modalviewcontroller

这个问题在这里已经有了答案:





Modal Dialog Does Not Dismiss Keyboard

(7 个回答)


8年前关闭。




我在我的 iPad 上使用 UIModalPresentationFormSheet 演示样式和 UIModalTransitionStyleCoverVertical 过渡样式呈现了一个模态视图 Controller 。
模态视图 Controller 包含一个 UIWebView,上面有一些 TextFields。
当用户点击其中一个文本字段时,键盘就会出现。

我注意到在显示键盘后的横向模式下,如果我尝试使用动画关闭模态视图 Controller ,则 View 会在动画开始之前将其位置从屏幕中心更改为左侧。

仅当键盘已打开且仅在 iPad 上处于横向模式时才会发生这种情况。如果用户在没有按下任何文本字段的情况下关闭模态视图,则不会发生这种情况。

有人熟悉这种奇怪的行为吗?

最佳答案

我刚刚找到了解决方案。在当前响应者上调用 resignFirstResponder,然后调用dismissModalViewControllerAnimated"。

绝对是 iOS 的一个错误,但这对我有用。

关于animation - 横向iPad上带有键盘的模态视图 Controller 在关闭时更改位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2898353/

相关文章:

Android 谷歌地图 v2 : animate marker size

ios - 如何在 iPad 中创建 Popover?

html - 关于视口(viewport)的问题

iOS 在 iPad 详细 Split View中更改 iAD 横幅大小

ios - 如何将对对象的引用传递给导航 Controller 中包含的模态呈现的 View Controller ?

javascript - CSS 过渡以在单击时将点分页移动到左/右

Android alpha 动画 : Staying in last animation frame when animation is completed

ios - 当 Controller 以模态方式呈现时,将数据传递给不同的 View Controller ?

iphone - iOS 标签栏不显示模态视图

angularjs - 在Angular 1.4+中页面加载时ng-repeat交错动画