- iOS的鍵盤有幾個通知
UIKeyboardWillShowNotification
UIKeyboardDidShowNotification
UIKeyboardWillHideNotification
UIKeyboardDidHideNotification
- 每一個通知的具體內(nèi)容是什么呢
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {375, 258}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {187.5, 796}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {187.5, 538}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 667}, {375, 258}}";
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 409}, {375, 258}}";
UIKeyboardIsLocalUserInfoKey = 1;
- 鍵盤大小的轉(zhuǎn)換
通知里的大小是屏幕坐標系中的大小和位置,沒有考慮旋轉(zhuǎn)。因此需啊一次轉(zhuǎn)化叠赐。
let rect = self.view.convertRect(keyboardrect!, fromView: nil)
- 為啥不能假設(shè)鍵盤有一個固定的大小
- 不同輸入法的鍵盤大小可能不同
iOS9 的中文輸入法比英文的大那么一點點
- 不同版本的鍵盤大小也不同
- 屏幕旋轉(zhuǎn)時慧妄,屏幕的大小也不同
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者