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 dismi开发者_Go百科ss 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?
I ran into this same issue with UITextView, I ended up subclassing UITextView and overriding resignFirstResponder as follows...
- (BOOL)resignFirstResponder{
[super resignFirstResponder];
// For some reason, UITextView doesn't like to give up first responder, ever....
return YES;
}
I haven't checked if this is still necessary in 4.3 but it was definitely needed in 3.2 in some cases.
精彩评论