开发者

Keyboard hide in iPad don't work

开发者 https://www.devze.com 2023-01-11 12:50 出处:网络
I have many views and the problem appears in all of them. I have \'n\' UITextField\'s in a UIView, I implement the UITextFieldDelegate method to hide the keyboard when the user press the \"Done\" butt

I have many views and the problem appears in all of them. I have 'n' UITextField's in a UIView, I implement the UITextFieldDelegate method to hide the keyboard when the user press the "Done" button like this:

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resign开发者_C百科FirstResponder];
    return YES;
}

Nothing special. The problem is that doesn't work. The method executes without problem but the keyboard doesn't hide.

Any help?


The problem was that the view where the field was display was deployed as UIModalPresentationFormSheet, change it to UIModalPresentationPageSheet fix the problem.

0

精彩评论

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