UIKeyBoard resize on orientation change to landscape

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-03-19T02:40:18Z Indexed on 2010/03/26 7:53 UTC
Read the original article Hit count: 718

This is very rookie question. I have a UIToolBar at the bottom which is supposed to animatedly move up and down with key board when the UIKeyBoard is displayed. I got that working with the help of UIKeyBoard Notifications. The view we are talking about has split view enabled. When device orientation is landscape, both the views as columns are shown [hope that makes sense].

When key board is shown, i do this

CGSize keyBoardSize = [[notificationInfo objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size;

CGRect toolbarFrame= [BottomToolBar frame];
toolbarFrame.origin.y -= keyBoardSize.height;    
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
BottomToolBar .frame = viewFrame;
[UIView commitAnimations];

when key board is hiiden i do this

toolbarFrame.origin.y += keyBoardSize.height;

My Problem is when device orientation changes to landscape, when the key board is visible the bottom tool bar is gone. I see it move up quickly. I am not sure how to fix this. Can anyone help please? Also, is there a way to NOT make the key board span across both the views in the split view?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about uikeyboard