我正在尝试移动键盘,但我似乎无法从下面的通知中获得值是我的代码和日志:
- (void)keyboardWasShown:(NSNotification *)notification
{
NSDictionary *info = [notification userInfo];
CGSize keyboardSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
NSLog(@"info dictionary %@", info);
NSLog(@"keyboard height: %f", keyboardSize.height);
日志:
2013-06-19 15:03:37.777 DepreciationDraft[5822:c07] info dictionary (null)
2013-06-19 15:03:37.777 DepreciationDraft[5822:c07] keyboard height: 0.000000
有什么建议么?