なぜこれが起こっているのかわかりません..
ユーザーがテキスト フィールドに入力を開始したときにビューをアニメーション化しようとしています。しかし、コードは横向きの左向きでのみ機能し、横向きの右向きでは機能しません...
これらのメソッドは両方の方向で呼び出されます...
ここにコードがあります..
- (void)keyboardWasShown:(NSNotification *)aNotification {
if ( keyboardShown )
return;
NSTimeInterval animationDuration = 0.3;
CGRect frame = self.view.frame;
frame.size.width += 150;
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:animationDuration];
self.view.frame = frame;
[UIView commitAnimations];
keyboardShown = YES;
}
- (void)keyboardWasHidden:(NSNotification *)aNotification {
NSTimeInterval animationDuration = 0.3;
CGRect frame = self.view.frame;
frame.size.width -= 150;
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:animationDuration];
self.view.frame = frame;
[UIView commitAnimations];
keyboardShown = NO;
}
今のところ、値をハードコーディングしました..