- (void) viewWillAppear:(BOOL)animated{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (keyBoardDidShow:)name: UIKeyboardDidShowNotification object:nil];
[super viewWillAppear:animated];
}
-(void) viewWillDisappear:(BOOL)animated{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil];
[super viewWillDisappear:animated];
}
-(void) keyBoardDidShow:(NSNotification *) notify{
NSLog(@"键盘打开!");
}