Cocoa Touch - keyboard keeps hiding itself
I am trying to move my view when the user selects a text field so that the text field is still visible, which I have achieved. I am also using a control event to ensure that the text fi开发者_JS百科eld is not empty before enabling a button.
Using
[longTextField addTarget:self action:@selector(updateAnswerButtonEnabled:) forControlEvents:UIControlEventEditingChanged];
- (void)textFieldDidBeginEditing:(UITextField *)textField {
and
- (void)textFieldDidEndEditing:(UITextField *)textField {
causes the keyboard to hide itself after every character input. Why is this and how should I get around it?
Having experimented, calling the method updateAnswerButtonEnabled from textFieldDidEndEditing has the desired response. However, I am interested to know what causes the strange behaviour with the first method I posted.
精彩评论