標籤:style blog io ar color os sp div on
//將要顯示鍵盤 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willShowKeyboard:) name:UIKeyboardWillShowNotification object:nil]; //將要隱藏鍵盤 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willHideKeyboard:) name:UIKeyboardWillHideNotification object:nil]; //顯示鍵盤完成 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DidShowKeyboard:) name:UIKeyboardDidShowNotification object:nil]; //隱藏鍵盤完成 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DidHideKeyboard:) name:UIKeyboardDidHideNotification object:nil]; //鍵盤frame將要改變 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidChange:) name:UIKeyboardDidChangeFrameNotification object:nil]; //鍵盤frame將要改變 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChange:) name:UIKeyboardWillChangeFrameNotification object:nil];
iOS 監聽鍵盤變化