title: iPad FormSheet/PageSheet modal view, when rotated fill entire screen.T
body: <p>I have a iPad application, which has a <code>UITabBarController</code> as the root controller. From one of the tabs, I have a <code>UIToolBar</code> which contains a <code>UIBarButtonItem</code>, when clicked launches a Modal View. </p>
  
  <p>The modal view appears in the correct size when first launched (in both landscape and portrait) however if you rotate the device, the modal view will then expand to fill the screen - regardless of how much you rotate the device from that point onwards.</p>
  
  <p>I'm launching the modal view from the tab bar and I've set the <code>ModalPresentationStyle</code> in the view to be presented. </p>
  
  <p>This affects the ModalView regardless of whether I set it to <code>FormSheet</code> or <code>PageSheet</code>. </p>
  
  <p>Has anyone experienced similar behaviour, if so, how did you solve it? </p>
  
  <p>Many thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've also noticed that since 4.2 when using a Modal Style Page/FormSheet that the view behind the Modal View isn't dimmed out anymore - am I presenting the view wrong or is this just standard on 4.2? </p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Code:
  In my default <code>UIViewController</code> I simply present the Modal view as follows:</p>
  
  <pre><code>void HandleNewMsgButtonTouch(object sender, EventArgs e)
  {
     PresentModalViewController(new ComposeMsgView(), true);
  }
  </code></pre>
  
  <p>In the modal view itself, I've specified in the <code>LoadView</code> override:</p>
  
  <pre><code>public override void LoadView()
  {
     base.LoadView ();
     ...
     // initialser code related to the view
     ...
     View.AutoresizingMask = UIViewAutoresizing.None;
     ModalPresentationStyle = UIModalPresentationStyle.PageSheet;
     ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
  }
  </code></pre>
  
  <p>I've overriden the <code>ShouldAutoRotateToInterfaceOrientation</code> to always return true as well.</p>
  
  <p>Regardless of whether I use Formsheet / Pagesheet, they both appear the correct width when first launched (whether in landscape or portrait - I'm aware PageSheet will fill the portrait view) however on rotation, the modal view will then fill the screen (as if I had presented the ModalView with FullScreen).</p>