开发者

iPhone OS 3.2 (iPad) Modal View question

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜