title: Adjust frame of UIView after loading it from IB
body: <p>Update: cause of the issue was found, see below.</p>
  
  <p>I'm feeling a little embarrassed here since the answer to my question is probably dead simple, but I've been struggling with this piece of code for over a day and I can't figure out what's going on, so here goes:</p>
  
  <p>I've created a custom UIView subclass. By now, I've isolated the code to the part that's causing me headaches:</p>
  
  <pre><code>-(id) initWithCoder:(NSCoder *)aDecoder {
      if (self = [super initWithCoder:aDecoder]) {
          self.backgroundColor = [UIColor greenColor];
          self.frame = CGRectMake(0, 0, 320, 60);
          NSLog(@"%@", NSStringFromCGRect(self.frame));
      }
      return self;
  }
  </code></pre>
  
  <p>This code is called when my custom view is loaded from a XIB file. This code attempts to resize the view. It does that, and the NSLog statement gives the same CGRect back as I pass to the view. However, whatever value I provide, the rectangle's height is consistently 50 points smaller than it's supposed to be.</p>
  
  <p>If I create the view programmatically with similar code, the rectangle is drawn correctly:</p>
  
  <pre><code>-(id) initWithFrame:(CGRect)frame
  {
      if (self = [super initWithFrame:frame]) {
          self.backgroundColor = [UIColor orangeColor];
          self.frame = CGRectMake(0, 0, 320, 60);
          NSLog(@"%@", NSStringFromCGRect(self.frame));
      }
      return self;
  }
  </code></pre>
  
  <p>It drives me nuts. What could cause this?</p>
  
  <p>As an additional question, what methods could I use to analyze / visualize the dimensions of views once the app is running in the iPhone simulator?</p>
  
  <p>// Update:</p>
  
  <p>I finally found what caused the weird behavior of this UIView subclass. The view controller that loaded this view as its subview was loaded from a Tab Bar, which has a height of 49 points, so that got me thinking. Apparently, the default autoresizing options that are selected in interface builder cause the  view to resize, after the view's bounds get reset in my custom initializer method. Setting no autoresize behavior in Interface Builder solves the issue.</p>