ソースを参照

Hide the outline views during rotation and make sure they match up with the underlying tracked view following rotation.

Previously, the outline views would get positioned incorrectly after rotation.
Ryan Olson 12 年 前
コミット
08982132ea
共有1 個のファイルを変更した26 個の追加0 個の削除を含む
  1. 26 0
      Classes/Explorer Toolbar/FLEXExplorerViewController.m

+ 26 - 0
Classes/Explorer Toolbar/FLEXExplorerViewController.m

@@ -175,6 +175,32 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     return supportedOrientations;
 }
 
+- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
+{
+    for (UIView *outlineView in [self.outlineViewsForVisibleViews allValues]) {
+        outlineView.hidden = YES;
+    }
+    self.selectedViewOverlay.hidden = YES;
+}
+
+- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
+{
+    for (UIView *view in self.viewsAtTapPoint) {
+        NSValue *key = [NSValue valueWithNonretainedObject:view];
+        UIView *outlineView = self.outlineViewsForVisibleViews[key];
+        outlineView.frame = [self.view convertRect:view.bounds fromView:view];
+        if (self.currentMode == FLEXExplorerModeSelect) {
+            outlineView.hidden = NO;
+        }
+    }
+    
+    if (self.selectedView) {
+        self.selectedViewOverlay.frame = [self.view convertRect:self.selectedView.bounds fromView:self.selectedView];
+        self.selectedViewOverlay.hidden = NO;
+    }
+}
+
+
 #pragma mark - Setter Overrides
 
 - (void)setSelectedView:(UIView *)selectedView