pragma mark 通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:)name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
pragma mark 键盘隐藏通知
- (void)keyboardWillHide:(NSNotification *)notif{
[self.otherReasonTF resignFirstResponder];
PRJ_Goods * model = [self.modeldataArray objectAtIndex:(_otherReasonTF.tag -100)];
model.otherReason = _otherReasonTF.text;
[[NSNotificationCenter defaultCenter] postNotificationName:@”reloadDate” object:nil userInfo:nil];
}
pragma mark 键盘上来通知
- (void)keyboardWasShown:(NSNotification *)notif{
//获取键盘高度
NSDictionary *info = [notif userInfo];
NSValue *value = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
CGSize keyboardSize = [value CGRectValue].size;
NSLog(@”—————————–keyBoard:%f”, keyboardSize.height);//406
}