4

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

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

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

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

4

2 回答 2

3

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

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

于 2010-07-21T22:18:52.283 回答
0

Yes! I'm thinking this is a bug, the Wordpress app exhibits this problem too, though strangely, Mail.app doesn't?

于 2010-06-05T09:31:38.880 回答