title: Why is the parent frame not kept the same size after dismissViewControllerAnimated?
body: <p>I've downloaded the PageControl sample code from apple. It's a project with a <code>UIPageControl</code>. I've changed it so that the <code>UIScrollView</code> has different views. For each view I want to add, I created a <code>UINavigationController</code> with a <code>rootViewController</code> as a subclass of either <code>UIViewController</code> or <code>UITableViewController</code>. Then I added into the <code>UIScrollView</code>, the view of the <code>navigationController</code>.</p>
  
  <p>Let's say I'm on the first view, now. I want to show a modal view controller. When I dismiss it, the parent view controller (<code>HomeViewController</code> in my example) is in full screen, rather than the size it was before, which would show the page control at the bottom. The only way I can make it work properly is by resizing the frame after the dismiss, but that's a bad user experience, because it is called after the parent view controller is shown. Any ideas on how to avoid the <code>HomeViewController</code> frame to be resized when dismissing a modal view controller?</p>
  
  <pre><code>-(void)dismissMVC:(id)sender {
      CGRect frame = self.view.frame;
      [self dismissViewControllerAnimated:YES completion:^{
          self.view.frame = frame;
      }];    
  }
  
  
  - (void)loadScrollViewWithPage:(int)page
  {
  if (page &lt; 0)
      return;
  if (page &gt;= kNumberOfPages)
      return;
  
  // replace the placeholder if necessary
  switch (page) {
      case Home:
      {
          HomeViewController *controller = [viewControllers objectAtIndex:page];
  
          if ((NSNull *)controller == [NSNull null])
          {
              controller = [[HomeViewController alloc] initWithPageNumber:page];
              [viewControllers replaceObjectAtIndex:page withObject:controller];
              [controller release];
          }
  
          // add the controller's view to the scroll view
          if (controller.view.superview == nil)
          {
              UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
              navController.navigationBar.barStyle = UIBarStyleBlack;
              [navController setNavigationBarHidden:YES];
              CGRect frame = scrollView.frame;
              frame.origin.x = frame.size.width * page;
              frame.origin.y = 20;
              frame.size.height = frame.size.height - 20;
              navController.view.frame = frame;
              controller.view.frame = frame;
              [controller setNavController:navController];
  
              [scrollView addSubview:navController.view];
              [navController release];
          }
          break;
      }
  }
  }
  </code></pre>