当键盘出现时,我想在我的应用程序中运行一个方法。是否有预定义的方法或者我必须创建它?以及如何创建它?
问问题
128 次
您可以在键盘出现时收到通知:
UIKeyboardWillShowNotification
UIKeyboardDidShowNotification
您可以像这样注册通知:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification object:nil];
更多在这里。