之前,我想要得到的鍵盤的大小,我這樣做如下:要獲得鍵盤的大小,它表明
- (void)viewDidLoad
{
....
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
....
}
//I can get the size here
- (void)keyboardWillShow:(NSNotification *)notification
{
NSDictionary *userInfo = [notification userInfo];
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGRect keyboardRect = [aValue CGRectValue];
}
但現在,我想鍵盤之前得到大小(在調用「keyboardWillShow」方法之前)。我該怎麼做?
檢查此鏈接:http://stackoverflow.com/questions/4213878/what-is-the-height-of-ipads-onscreen-keyboard – Amit 2013-04-24 06:47:49