2012年1月31日 星期二

取得keyboard 座標和寬高(CGRect)

- (void) keyboardWillShow:(NSNotification*) notification
{
    NSDictionary* info = [notification userInfo];
    NSValue* aValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
    CGRect keyboardRect = [aValue CGRectValue];
    NSLog(@"keyboardRect y:%f height:%f", keyboardRect.origin.y, keyboardRect.size.height);
}

沒有留言: