基础迁移-键盘弹起 收回

2018-12-20  本文已影响0人  忆往昔Code

//监听当键盘将要出现时
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];

//监听当键将要退出时
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyboardWillHide:)
                                             name:UIKeyboardWillHideNotification
                                           object:nil];

//当键盘出现

//当键退出

}

上一篇 下一篇

猜你喜欢

热点阅读