为名为“ UIKeyboardWillChangeFrameNotification”的通知添加观察者。
通知的“ userInfo”字典在屏幕上具有多个键盘框架。
添加观察者
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logNotification:) name:UIKeyboardWillChangeFrameNotification object:nil];
记录器的选择器
- (void)logNotification:(NSNotification *)notification {
NSLog(@"%@", notification);
}
userInfo字典内容
userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = 0;
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 441.5}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 315}, {320, 253}}";
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
UIKeyboardIsLocalUserInfoKey = 1;
}}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句