IPad issue when sliding the keyboard to hide it

This commit is contained in:
Yannick Le Collen 2014-12-16 18:56:25 +01:00
parent 53504e58c1
commit 3d2a3b159e

View file

@ -577,10 +577,18 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
CGFloat screenHeight = 0;
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
UIViewController* rootViewController = self;
// get the root view controller to extract the application size
while (rootViewController.parentViewController && ![rootViewController isKindOfClass:[UISplitViewController class]]) {
rootViewController = rootViewController.parentViewController;
}
// IOS 6 ?
// IOS 7 always gives the screen size in portrait
// IOS 8 takes care about the orientation
if (self.view.frame.size.width > self.view.frame.size.height) {
if (rootViewController.view.frame.size.width > rootViewController.view.frame.size.height) {
screenHeight = MIN(screenSize.width, screenSize.height);
}
else {