title: How do I keep my modal dialog close to the top in both landscape modes objective-c
body: <p>I'm using this to change the width and height of the modal dialog</p>
  
  <pre><code>- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterface {
       if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
  
              self.view.superview.frame = CGRectMake(74, 170, 380.0f, 712.0f);
  
          }
  }
  </code></pre>
  
  <p>The <code>self.view.superview.frame = CGRectMake(74, 170, 380.0f, 712.0f);</code> works will on the one landscape but when you turn the iPad around the y position is to low. It needs to be at the same y position for both landscapes.</p>
  
  <p><strong>edit</strong></p>
  
  <p>This seams to work. Not sure if its the best answer. Will accept better answers. </p>
  
  <pre><code>if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
  
              self.view.superview.frame = CGRectMake(174, 170, 380.0f, 712.0f);
              self.view.superview.transform = CGAffineTransformTranslate(self.view.superview.transform,0,-72);
  
          }
  </code></pre>