当被解雇模式视图控制器,键盘上的景观iPad的改变位置 [英] Modal View Controller with keyboard on landscape iPad changes location when dismissed

查看:136
本文介绍了当被解雇模式视图控制器,键盘上的景观iPad的改变位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我present在模态视图控制器我对我的iPad与UIModal presentationFormSheet presentation风格和UIModalTransitionStyleCoverVertical过渡方式。
模态视图控制器包含了一些关于它的TextField一个UIWebView。
当用户点击文本的领域键盘上来。

I present a modal view controller on my on my iPad with UIModalPresentationFormSheet presentation style and UIModalTransitionStyleCoverVertical transition style. The Modal View Controller contains a UIWebView with some TextFields on it. When the user taps one of the text fields the keyboard comes up.

我注意到,在键盘后横向模式显示,如果我尝试用解雇动画模态视图控制器的看法改变了从屏幕中心到左侧就在动画开始前的位置..

I have noticed that in landscape mode after the keyboard is shown, if I try to dismiss the modal view controller with animation the view changes its position from the center of the screen to the left side just before the animation starts..

这种情况只有当键盘和只有在iPad上的横向模式。如果用户关闭任何文本字段没有pressing模态视图不会发生这种情况。

This happens only if the keyboard is up and only in landscape mode on the iPad. If the user closes the modal view without pressing on any text field this doesn't happen.

任何人都熟悉这个奇怪的行为?

Anyone familiar with this strange behavior?

推荐答案

我刚刚找到一个解决的办法。在当前应答呼叫resignFirstResponder,然后调用dismissModalViewControllerAnimated。

I just found a solution to this. Call resignFirstResponder on the current responder and then call dismissModalViewControllerAnimated".

这绝对是一个与iOS错误,但这个对我的作品。

Definitely a bug with iOS but this works for me.

这篇关于当被解雇模式视图控制器,键盘上的景观iPad的改变位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆