浏览代码

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;
     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
 #pragma mark - Setter Overrides
 
 
 - (void)setSelectedView:(UIView *)selectedView
 - (void)setSelectedView:(UIView *)selectedView