- Improved fix for UI elements positioning at GameConfigViewController ios-revival
authorantonc27 <antonc27@mail.ru>
Sat, 15 Aug 2015 20:38:07 +0200
branchios-revival
changeset 11132 ccf095d96ef4
parent 11125 432601e160b4
child 11133 fa3d227fb308
- Improved fix for UI elements positioning at GameConfigViewController
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Aug 15 02:22:17 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Aug 15 20:38:07 2015 +0200
@@ -325,7 +325,7 @@
     if (IS_IPAD() == NO)
         return;
 
-    [self updateUIForInterfaceOrientation:toInterfaceOrientation];
+    [self updateiPadUIForInterfaceOrientation:toInterfaceOrientation];
 
     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
                                                                             duration:duration];
@@ -335,7 +335,7 @@
     }
 }
 
-- (void)updateUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+- (void)updateiPadUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {
     if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
          interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
@@ -363,9 +363,12 @@
 //    if (IS_IPAD())
 //        [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
     
-    // we assume here what 'statusBarOrientation' will never be changed manually!
-    UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
-    [self updateUIForInterfaceOrientation:currentOrientation];
+    if (IS_IPAD())
+    {
+        // we assume here what 'statusBarOrientation' will never be changed manually!
+        UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+        [self updateiPadUIForInterfaceOrientation:currentOrientation];
+    }
     
     [self.mapConfigViewController viewWillAppear:animated];
     [self.teamConfigViewController viewWillAppear:animated];