- Possible fix for wrong layout on iOS 9 when going back from rotated stats page (for iPad) ios-revival
authorantonc27 <antonc27@mail.ru>
Sat, 17 Oct 2015 00:32:02 +0200
branchios-revival
changeset 11219 51cc7ec00c2d
parent 11218 d8135421833c
child 11220 76fd61a88c1e
- Possible fix for wrong layout on iOS 9 when going back from rotated stats page (for iPad) Note: Tested only in simulator
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Fri Oct 16 17:34:06 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Oct 17 00:32:02 2015 +0200
@@ -328,8 +328,6 @@
 
     [self updateiPadUIForInterfaceOrientation:toInterfaceOrientation];
 
-    [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
-                                                                            duration:duration];
     if (self.helpPage)
     {
         self.helpPage.view.frame = self.view.frame;
@@ -374,6 +372,18 @@
     [super viewWillAppear:animated];
 }
 
+- (void)viewDidAppear:(BOOL)animated
+{
+    [super viewDidAppear:animated];
+
+    if (IS_IPAD())
+    {
+        // need to call this again in order to fix layout on iOS 9 when going back from rotated stats page
+        UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+        [self updateiPadUIForInterfaceOrientation:currentOrientation];
+    }
+}
+
 -(void) didReceiveMemoryWarning {
     self.imgContainer = nil;