使用NSValue的valueWithCGRect:等方法转换成NSValue对象,而不是NSStringFromCGRect()等方法转换成NSString对象。
NSDictionary *userInfo = @{
@"UIKeyboardFrameBeginUserInfoKey" : [NSValue valueWithCGRect:CGRectMake(0, UIApplication.screenHeight - 216, UIApplication.screenWidth, 216)],
@"UIKeyboardFrameEndUserInfoKey" : [NSValue valueWithCGRect:CGRectMake(0, UIApplication.screenHeight - 258, UIApplication.screenWidth, 258)],
};
[NSNotificationCenter.defaultCenter postNotificationName:UIKeyboardWillChangeFrameNotification
object:nil
userInfo:userInfo];
网友评论