Преглед изворни кода

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