detect iPad keyboard Hiding button

前端 未结 4 1788
有刺的猬
有刺的猬 2020-12-18 03:00

Hi is there any way to detect iPad keyboard hiding button ? i mean when user press this button :

\"alt

4条回答
  •  伪装坚强ぢ
    2020-12-18 03:23

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldShouldReturn:) name:UIKeyboardWillHideNotification object:nil];

    This actually crashes on the go.

    But if you call a custom method, like: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myCustomeMethodToResignTextFieldResponder) name:UIKeyboardWillHideNotification object:nil];

    Then it will work just fine.. :-)

提交回复
热议问题