title: How to set constraint with a specific width and height view
body: <p>I had set some constraints with visual format language to my UIImageView( a little star).</p>
  
  <p>Here is my code:</p>
  
  <pre><code>        //Bottom
      format = @"V:|-[_title]-|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_bottom addConstraints:constraintsArray];
  
      format = @"V:|-[_stars(==17)]-|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_bottom addConstraints:constraintsArray];
  
      format = @"V:|-15-[_number]-15-|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_bottom addConstraints:constraintsArray];
  
      format = @"H:|-[_title(240)]-[_stars(17)]-[_number]-|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_bottom addConstraints:constraintsArray];
  </code></pre>
  
  <p>Note that the _bottom is the super view where I added constraints and I had set the <code>_stars's frame</code> to <code>17 * 17</code>. But the position of the <code>_stars</code> is not at the vertical center. </p>
  
  <p><img src="https://i.stack.imgur.com/8bTIN.png" alt="enter image description here"></p>
  
  <p>How can I fix this? This is what i want. <strong>Is there a way to set the view to vertival center?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/6OcN2.png" alt="enter image description here"></p>
  
  <p>Thanks a lot for advice.</p>
  
  <p><strong>Edit：</strong> _bottom 's code.</p>
  
  <pre><code>    format = @"V:|[_top(100)][_bottom]|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_background addConstraints:constraintsArray];
  
      format = @"H:|[_bottom]|";
      constraintsArray = [NSLayoutConstraint constraintsWithVisualFormat:format options:0 metrics:nil views:viewsDictionary];
      [_background addConstraints:constraintsArray];
  </code></pre>