iPhone OS 3.2 (iPad) 模态视图问题
我将 UIViewController 作为模态视图控制器呈现,其中 modalPresentationStyle = UIModalPresentationFormSheet。我的视图上有几个 UITextFields。
我的问题是,当我尝试关闭键盘([textfieldname resignFirstResponder])时,它不会执行任何操作。但是,当我将 modalPresentationStyle 更改为 UIModalPresentationPageSheet 时,它就可以工作。
这似乎是一个错误。有没有人遇到类似的问题并找到解决方法?我会做一些愚蠢的事情吗?
I am presenting a UIViewController as a modal viewcontroller with modalPresentationStyle = UIModalPresentationFormSheet. I have few UITextFields on its view.
My issue is that when I try to dismiss the keyboard ([textfieldname resignFirstResponder]), it doesn't do anything. However when I change the modalPresentationStyle to UIModalPresentationPageSheet, it works.
This seems to be a bug. Has any one faced similar problems and found a work around? Could I be doing anything dumb and silly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 UITextView 中遇到了同样的问题,我最终对 UITextView 进行了子类化并重写了 resignFirstResponder ,如下所示...
我还没有检查这在 4.3 中是否仍然有必要,但在某些情况下在 3.2 中肯定需要它。
I ran into this same issue with UITextView, I ended up subclassing UITextView and overriding resignFirstResponder as follows...
I haven't checked if this is still necessary in 4.3 but it was definitely needed in 3.2 in some cases.