瀏覽代碼

Fix iPhone +

Marino Faggiana 7 年之前
父節點
當前提交
0729020fb2
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      iOSClient/Main/CCSplit.m

+ 14 - 2
iOSClient/Main/CCSplit.m

@@ -75,6 +75,20 @@
 
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
 {
+    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+
+    // iPhone +
+    if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact && ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone && UIScreen.mainScreen.nativeBounds.size.height == 2208)) {
+    
+        UITabBarController *tbc = self.viewControllers.firstObject;
+        for (UINavigationController *nvc in tbc.viewControllers) {
+        
+            if ([nvc.topViewController isKindOfClass:[CCDetail class]]) {
+                [nvc popViewControllerAnimated:NO];
+            }
+        }
+    }
+
     [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
         
         if (self.view.frame.size.width == ([[UIScreen mainScreen] bounds].size.width*([[UIScreen mainScreen] bounds].size.width<[[UIScreen mainScreen] bounds].size.height))+([[UIScreen mainScreen] bounds].size.height*([[UIScreen mainScreen] bounds].size.width>[[UIScreen mainScreen] bounds].size.height))) {
@@ -86,8 +100,6 @@
             // Landscape
         }
     }];
-    
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
 }
 
 #pragma --------------------------------------------------------------------------------------------