iOS8 / iOS8中Apple系统键盘的高度是多少?

时间:2015-11-04 07:05:26

标签: ios xcode uikeyboard

iOS 8以后Apple System键盘的高度是多少?没有位于键盘顶部的预测文本栏?

1 个答案:

答案 0 :(得分:1)

使用

NSValue* keyboardFrame = [keyboardInfo valueForKey:UIKeyboardFrameEndUserInfoKey];

详细值

UIKeyboardWillChangeFrameNotification的观察者添加到viewDidLoad;

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChange:) name:UIKeyboardWillChangeFrameNotification object:nil];

委托方法

- (void)keyboardWillChange:(NSNotification *)notification {
    NSDictionary* keyboardInfo = [notification userInfo];
    NSValue* keyboardFrame = [keyboardInfo valueForKey:UIKeyboardFrameEndUserInfoKey];
   NSLog("value ==%@",keyboardFrame);
}