开发者

iPhone OS 3.2 (iPad) Modal View question

开发者 https://www.devze.com 2022-12-25 19:33 出处:网络
I am presenting a UIViewController as a modal viewcontroller with modalPresentationStyle = UIModalPresentationFormSheet. I have few UITextFields on its view.

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.

0

精彩评论

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