APP中有时候会出现键盘遮挡输入框的问题,这个时候就需要对键盘进行管理
可选择如下两种方式进行管理:
1.手动管理键盘
代码如下:
- (void)viewDidLoad {
[super viewDidLoad];
//键盘处理
[self dealWithKeyboard];
}
- (void)dealWithKeyboard{
//增加监听,当键盘出现时响应
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
//增加监听&#