Skip to content
Browse files

Fixed bug when switching views and changing orientation. See Issue #16.

  • Loading branch information...
1 parent d15e15d commit 2ce7ce5a5d9dab39d14551b0f4ea7fbd8f1e556d @baalexander committed Jan 4, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 Classes/RootViewController.m
View
7 Classes/RootViewController.m
@@ -55,7 +55,7 @@ -(IBAction)switchAbout:(id)sender
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationBeginsFromCurrentState:NO];
- [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.subview cache:YES];
+ [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.subview cache:NO];
// Remove whatever view is currently showing
for (UIView *view in self.subview.subviews)
@@ -84,6 +84,7 @@ -(IBAction)switchAbout:(id)sender
[aboutViewController release];
}
+ self.aboutViewController.view.frame = CGRectMake(0, 0, self.subview.frame.size.width, self.subview.frame.size.height);
[self.subview addSubview:self.aboutViewController.view];
}
@@ -114,6 +115,9 @@ - (void)directoryDidChange:(DirectoryWatcher *)folderWatcher
[instructionsViewController release];
}
+ // Set the frame size manually to fix a bug where switching views and
+ // changing orientation shifts this new subview around
+ self.instructionsViewController.view.frame = CGRectMake(0, 0, self.subview.frame.size.width, self.subview.frame.size.height);
[self.subview addSubview:self.instructionsViewController.view];
}
else
@@ -144,6 +148,7 @@ - (void)directoryDidChange:(DirectoryWatcher *)folderWatcher
self.filesViewController.documentUrls = self.documentUrls;
[self.filesViewController.tableView reloadData];
+ self.filesViewController.view.frame = CGRectMake(0, 0, self.subview.frame.size.width, self.subview.frame.size.height);
[self.subview addSubview:self.filesViewController.view];
}
}

0 comments on commit 2ce7ce5

Please sign in to comment.
Something went wrong with that request. Please try again.