IOS 8 orientation issues: keyboard ends up in the wrong position

I have a universal iOS project that was created in xCode 5, which I am trying to connect to xCode 6. It seems that everything was fine, since I do not use LaunchScreen , and the iPhone 6 and 6 Plus scale the application to their resolution.

A problem occurs when the device changes orientation.

Scenario:

This only happens on the iPhone 6 and 6 Plus.

Open the login screen with the username and password fields. Turn the device into "Landscape" and touch the username or password field. The keyboard appears in the middle of the screen with half a cut. Turning back to the portrait completely hides the keyboard, and it no longer appears on the screen no matter what field you enter.

To bring the keyboard back, select "Landscape", tap the field, rotate the device opposite the Landscape (do not release it in "Portrait"). The keyboard suddenly becomes normal and functioning normally.

Problematic Keyboard

+5
source share
5 answers

I have the same problem, and this is because your application runs in scaled mode.
It seems that Apple has not gone the full way to manage the landscape in this scaled mode.

The solution is to switch to unscaled mode for the iPhone 6-6Plus using the trick listed here: How do I enable native resolution for apps on the iPhone 6 and 6 Plus?

Note that this will likely break many of your screens in the process. But there is no other solution.

+5
source

I ran into this problem in scalable application mode. Despite the fact that support for non-pegging mode (by adding images for iPhone x and 6+ for xcassets) solves this problem, in my case this was unacceptable, since the screens had a static layout for each orientation. I could solve this problem by avoiding the incidents of changing the window root view controller. Instead, new view controllers were added (with the de-balancing removed) as a subview (and therefore childViewController) to the existing root view controller.

0
source

Everything is fine on iOS6 / 7, but not on iOS8.

The keyboard orientation on iOS 8 does not match the status bar.

0
source

If your application only works in portrait mode, you can stop generating orientation notifications;

 [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; 
0
source

I ran into this problem, and after some research, I found something that caused such an error. In my AppDelegate application, I changed the rootViewController window to show different ViewControllers, depending on the authorization status

 if (!auth) { self.window.rootViewController = [[AuthViewController alloc] init]; } else { self.window.rootViewController = [[DataViewController alloc] init]; } 

I removed this and moved the controller selection logic to the NavigationViewController

 if (!auth) { self.viewControllers = @[[[AuthViewController alloc] init]]; } else { self.viewControllers = @[[[DataViewController alloc] init]]; } 

and make this NavigationViewController as the Storyboard initial view manager.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1206868/


All Articles