IPhone SDK: TextView, Keyboard in Landscape mode?

If you think you need different code for the different orientations, you're doing something else wrong. Once the orientation has changed and your superview has responded, the value that needs changing should always be the frame's height.

If this is true why does this code: CGRect keyboardRect = aNotification userInfo objectForKey:UIKeyboardBoundsUserInfoKey CGRectValue; NSTimeInterval animationDuration = aNotification userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey doubleValue; CGRect frame = self.view. Frame; frame.size. Height -= keyboardRect.size.

Height; UIView beginAnimations:@"ResizeForKeyboard" context:nil; UIView setAnimationDuration:animationDuration; self.view. Frame = frame; UIView commitAnimations; result in a view that moves to the right while in Landscape mode? – Arnold Jun 14 '10 at 14:29.

I found the above code wouldn't work when in Landscape Mode on iPad Note: I am moving all Fields, as in my case that's what I needed :-) - (void)keyboardWillShow:(NSNotification*)aNotification { // Only do for Landscape Mode if (UIInterfaceOrientationIsLandscape(self interfaceOrientation)){ NSDictionary *info = aNotification userInfo; NSValue *aValue = info objectForKey:UIKeyboardBoundsUserInfoKey; CGSize keyboardSize = aValue CGRectValue. Size; NSTimeInterval animationDuration = 0.300000011920929; CGRect frame = self.view. Frame; frame.origin.

X -= keyboardSize. Height-44; frame.origin. Y -= keyboardSize.

Height-44; frame.size. Height += keyboardSize. Height-44; UIView beginAnimations:@"ResizeForKeyboard" context:nil; UIView setAnimationDuration:animationDuration; self.view.

Frame = frame; UIView commitAnimations; viewMoved = YES; } keyboardInUse = YES; } - (void)keyboardWillde:(NSNotification*)aNotification { if (UIInterfaceOrientationIsLandscape(self interfaceOrientation)){ if (viewMoved) { NSDictionary *info = aNotification userInfo; NSValue *aValue = info objectForKey:UIKeyboardBoundsUserInfoKey; CGSize keyboardSize = aValue CGRectValue. Size; NSTimeInterval animationDuration = 0.300000011920929; CGRect frame = self.view. Frame; frame.origin.

Y += keyboardSize. Height-44; frame.origin. X += keyboardSize.

Height-44; frame.size. Height -= keyboardSize. Height-44; UIView beginAnimations:@"ResizeForKeyboard" context:nil; UIView setAnimationDuration:animationDuration; self.view.

Frame = frame; UIView commitAnimations; viewMoved = NO; } } keyboardInUse = NO; }.

How do I make sure that the textview is shown and the keyboard is not obscuring the textview, while in landscape. Using UICatalog I created a TextViewController which works. In it there are two methods for calling the keyboard and making sure that textView is positioned above the keyboard.

His just works great in Portrait mode. I got the Landscape mode working, but on the textView is still being put to the top of the iPhone to compensate for the keyboard in portrait mode. I changed the methods for showing the keyboards.

I know that I have to change the line frame.size. Height -= keyboardRect.size. Height but I do not seem to get it working.

I tried frame.size. Width -= keyboardRect.size. Height that did not work.

Losing the keyboardRect and frame all together work, however off course the keyboard obscures the textview........

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions