'UIKeyboardBoundsUserInfoKey' 메소드가 더이상 지원되지 않을 예정이므로 다른 메소드를
사용하여야 한다. 당장 SDK에서 제거 되는것은 아니지만 차기 버전에서 없어질 가망성이 있다.
- (void) keyboardDidShow:(NSNotification *) notif {
if (keyboardVisible ) {
return;
}
//NSDictionary *notification = [notif userInfo];
//NSValue * aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];
//CGSize keyboardSize = [aValue CGRectValue].size;
//CGRect viewFrame = self.view.frame;
//viewFrame.size.height -= keyboardSize.height;
// 'UIKeyboardBoundsUserInfoKey' is deprecated
// 위와 같은 Warning 발생하여 아래와 같이 수정
CGRect keyboardEndFrame;
CGFloat keyboardHeight;
[[notif.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndFrame];
if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown) {
keyboardHeight = keyboardEndFrame.size.height;
}
else {
keyboardHeight = keyboardEndFrame.size.width;
}
CGRect viewFrame = self.view.frame;
viewFrame.size.height -= keyboardHeight;
scrollView.frame = viewFrame;
keyboardVisible = YES;
}
'공개 포스팅' 카테고리의 다른 글
아이팟 터치 4세대 출시일 ( 애플스토어에서 주문 완료 ) (0) | 2010.09.05 |
---|---|
아바타 스페셜 에디션 (0) | 2010.09.05 |
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key (0) | 2010.09.04 |
아이팟 터치 4세대 구매요청.!! (0) | 2010.09.03 |
알라딘 TTB Thanks to blogger (0) | 2010.09.03 |