title: Size a UIView created from a xib?
body: <p>I'm creating a UIView from a xib to eventually render into a UIImage.</p>
  
  <p>The UIView itself has internal constraints which work fine given a large enough frame size in IB. However, I need to size the width to some particular content, and I can't figure out how to set the width of the UIView after loading it from a xib.</p>
  
  <p><code>[[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil][0];</code></p>
  
  <p>To render the view, I do this:</p>
  
  <pre><code>UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0);
  [view.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  </code></pre>
  
  <p>No matter what I set the bounds to, however, the UIView is the same size as the initial size in IB. How can I set the size of the UIView such that it will cause internal constraints to resize and render correctly?</p>