Why is my view controllers view not quadratic?
<p>I created an UIViewController subclass, and figured out that the default implementation of -loadView in UIViewController will ignore my frame size settings in a strange way.</p>

<p>To simplify it and to make sure it's really not the fault of my code, I did a clean test with a plain instance of UIViewController directly, rather than making a subclass. The result is the same. I try to make an exactly quadratic view of 320 x 320, but the view appears like 320 x 200.</p>

<p>iPhone OS 3.0, please check this out:</p>

<pre><code>UIViewController *ts = [[UIViewController alloc] initWithNibName:nil bundle:nil];
ts.view.frame = CGRectMake(0.0f, 0.0f, 320.0f, 320.0f);
ts.view.backgroundColor = [UIColor cyanColor];
[self.view addSubview:ts.view];
</code></pre>

<p>like you can see, I do this:</p>

<p>1) Create a UIViewController instance</p>

<p>2) Set the frame of the view to a quadratic dimension of 320 x 320</p>

<p>3) Give it a color, so I can see it</p>

<p>4) Added it as a subview.</p>

<p>Now the part, that's even more strange: When I make my own implementation of -loadView, i.e. if I put this code in there like this:</p>

<pre><code>- (void)loadView {
    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 320.0f)];
    v.backgroundColor = [UIColor cyanColor];
    self.view = v;
    [v release];
}
</code></pre>

<p>then it looks right.</p>

<p>Now lets think about that: In the first example, I do pretty much exactly the same, just that I let UIViewController create the view on it's own, and then take it over in order to change it's frame. Right?</p>

<p>So why do I get this strange error? Right now I see no other way of messing around like that to correct this wrong behavior. I did not activate anything like clipsToBounds and there's no other code touching this.</p>
