开发者

Modal View Controller with keyboard on landscape iPad changes location when dismissed [duplicate]

开发者 https://www.devze.com 2022-12-31 05:29 出处:网络
This question already has answers here: Modal Dialog Does Not Dismiss Keyboard (7 answers) Closed 9 years ago.
This question already has answers here: Modal Dialog Does Not Dismiss Keyboard (7 answers) Closed 9 years ago.

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..

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 开发者_如何学Pythonwith this strange behavior?


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

Definitely a bug with iOS but this works for me.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消