n鍵盤狀態改變的時候,系統會發出一些特定的通知
ØUIKeyboardWillShowNotification // 鍵盤即將顯示
ØUIKeyboardDidShowNotification //鍵盤顯示完畢
ØUIKeyboardWillHideNotification // 鍵盤即將隱藏
ØUIKeyboardDidHideNotification // 鍵盤隱藏完畢
ØUIKeyboardWillChangeFrameNotification // 鍵盤的位置尺寸即將發生改變
ØUIKeyboardDidChangeFrameNotification //鍵盤的位置尺寸改變完畢
n系統發出鍵盤通知時,會附帶一下跟鍵盤有關的額外信息(字典),字典常見的key以下:
ØUIKeyboardFrameBeginUserInfoKey // 鍵盤剛開始的frame
ØUIKeyboardFrameEndUserInfoKey // 鍵盤最終的frame(動畫執行完畢後)
ØUIKeyboardAnimationDurationUserInfoKey // 鍵盤動畫的時間
ØUIKeyboardAnimationCurveUserInfoKey // 鍵盤動畫的執行節奏(快慢)ide
/*
UIKeyboardAnimationCurveUserInfoKey = 7; // 動畫執行的節奏
UIKeyboardAnimationDurationUserInfoKey = "0.25"; 鍵盤彈出/隱藏的動畫所須要的時間
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}」;//鍵盤的bounds
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 588}」;//鍵盤準備彈出時的X,Y的中心座標
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 372}」;//鍵盤彈出後的X,Y的中心座標
// 鍵盤彈出剛開始的那一刻的frame
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 480}, {320, 216}}";
// 彈出完畢的時候,鍵盤的frame
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 264}, {320, 216}}";
// 鍵盤退出的frame
// 鍵盤剛要退出那一刻的frame
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 264}, {320, 216}}";
// 鍵盤退出完畢那一刻的frame
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 480}, {320, 216}}";
*/動畫