这是出于图形设计原因,因此首选高度(以像素为单位)。 如果是这样的话,我认为不同语言的键盘可能会有不同的高度。那么美国/英国键盘的高度会更好吗?
最佳答案
无论何时显示,您都可以获得键盘的高度:
//add this line to viewDidLoad
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBordShown name:UIKeyboardDidShowNotification object:nil];
- (void)keyBordShown:NSNotification*)notification
{
NSDictionary* keyboardInfo = [notification userInfo];
NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey];
CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue];
}
因为这比静态设置键盘高度更好。
关于ios - iPad Air 的 iOS 键盘的像素高度是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25719750/