I need to support only Portrait mode for Keyboard view.
Because, I have an UIViewController that supports all orientations. It presents an View controller which supports only Portrait orientation and this view has an Text Field. When TextField becomes first responder Keyboard view is poped up. Now, if I change the device orientation, keyboard changes its orientation to Landscape.
How do I keep the keyboard in Portrait orientation?
Try this:
Create an iVar called
UIInterfaceOrientation previousOrientation
.When you say
[textField becomeFirstResponder];
add:Then in
[textField resignFirstResponder]
, when the user closes the keyboard or presses enter; You can revert to the original orientation.If you just need Portrait Orientation u can disable Autorotation with: