I came across a strange iOS 8.3 problem that shows the keyboard in the wrong orientation (the view controller is in landscape mode, but the keyboard is displayed in portrait mode):

I can cause this problem by following these steps:
Create 2 UIViewController subClass: ViewControllerA and ViewControllerB
in ViewControllerA implement supportedInterfaceOrientations and return UIInterfaceOrientationMaskPortrait
in ViewControllerB implement supportedInterfaceOrientations and return UIInterfaceOrientationMaskLandscape
Create a subclass of UINavigationController called NavigationController , implement supportedInterfaceOrientations and return [self.topViewController supportedInterfaceOrientations] (I do this because I want the NavigationController and its rootVC to rotate)
/ li>Use NavigationController as initial application view controller, set ViewControllerA as NavigationController rootViewContrller
Launch the application, ViewControllerA will appear in the portrait. Show the ViewControllerA button, click the ViewControllerB button using presentViewController:animated:completion
ViewControllerB appears in Landscape; Show the text field on ViewControllerB , click on the text field to ViewControllerB keyboard, but the keyboard is in portrait mode, as shown in the figure above.
PS. You can download and run the Xcode project on github
This issue only appears in iOS 8.3. Am I doing something wrong? Or maybe this is another iOS bug?
By the way, this problem will not happen if you just show ViewControllerA directly without ViewController . So, if this is an iOS error, how can I avoid subclassing the UINavigationController , but keep the ViewControllerA , which is the rootViewController of the UINavigationController from rotating.
UPDATE: this error still appears in iOS 8.4, I published a bug report and received answers from apple on June 17, 2015, they said that it was reviewed in the latest version of iOS 9.
source share