title: How to programmatically create UIView with landscape orientation?
body: <p>I have an iPad application with fixed landscape orientation. Everything works OK until the moment when I programmatically create UIView and add it to my root UIViewController's view - it's orientation is always set to portrait while all other content is displayed in landscape mode. This UIView is a modal view showing some custom form for user.</p>
  
  <pre><code>AlertView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];
  AlertView.opaque = NO;
  AlertView.backgroundColor = [UIColor blackColor];
  AlertView.alpha = 0.7;
  
  &lt;...&gt; // some other configuration code
  
  [window addSubview:AlertView];
  </code></pre>
  
  <p>So the question is: how can I initiate UIView with landscape orientation? All I can think of is using transform like:</p>
  
  <pre><code>modalView.transform = CGAffineTransformMakeRotation( ( 180 * M_PI ) / 360 );
  </code></pre>
  
  <p>Though it's not too elegant way...</p>