title: Constrain cameraOverlayView to center of screen
body: <p>I'm using zBAR QR Reader in an iPad app im creating and I've added a custom crosshair overlay to the <code>ZBarReaderViewController</code>. I've managed to get the overlay into the center, however when the device rotates, the overlay obviously goes off center. </p>
  
  <p>I've had a search around in regards to programmatically constraining the view but none of the suggestions have worked. I've tried every possible combination with <code>UIViewAutoResizingMask</code> and I've tried heaps of different setups with the <code>[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]</code> method. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>self.readerqr = [ZBarReaderViewController new];
  
  int readerPointX = ((self.view.bounds.origin.x) + (self.view.bounds.size.width / 2.0));
  int readerPointY = ((self.view.bounds.origin.y) + (self.view.bounds.size.height / 2.0) -60);
  
  self.readerqr.readerDelegate = self;
  self.readerqr.showsHelpOnFail = NO;
  
  CGRect viewFrame = CGRectMake(readerPointX, readerPointY, 200, 200);
  
  self.crossHair = [[UIImageView alloc] initWithFrame:viewFrame];
  
  self.crossHair.image = [UIImage imageNamed:@"qr.png"];
  
  [self.readerqr setCameraOverlayView:self.crossHair];
  
  constraint = [NSLayoutConstraint constraintWithItem:self.crossHair
                                            attribute:NSLayoutAttributeHeight
                                            relatedBy:NSLayoutRelationEqual
                                               toItem:nil
                                            attribute:NSLayoutAttributeNotAnAttribute
                                           multiplier:1
                                             constant:200];
  
  [self.crossHair addConstraint:constraint];
  
  constraint = [NSLayoutConstraint constraintWithItem:self.crossHair
                                            attribute:NSLayoutAttributeWidth
                                            relatedBy:NSLayoutRelationEqual
                                               toItem:nil
                                            attribute:NSLayoutAttributeNotAnAttribute
                                           multiplier:1
                                             constant:200];
  [self.crossHair addConstraint: constraint];
  </code></pre>
  
  <p>What is the proper way to set this up so my overlay will always be in the center of the screen regardless of orientation change? Any help would be great, thanks.</p>