//发送键盘消息
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardFrame:)
name:UIKeyboardDidShowNotification
object:nil];
/**
获取键盘高度
@param notification
@return nil
*/
- (void)keyboardFrame:(NSNotification *)notification{
// if(!isDisplayFaceBox){
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
#endif
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2
NSValue *keyboardBoundsValue = [[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey];
#else
NSValue *keyboardBoundsValue = [[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey];
#endif
CGRect keyboardBounds;
[keyboardBoundsValue getValue:&keyboardBounds];
NSLog(@"%@",NSStringFromCGRect(keyboardBounds));
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
}
#endif
}