title: How to change AVCaptureVideoPreviewLayer frame height and width
body: <p>Please help me how to change the AVCaptureVideoPreviewLayer frame size and </p>
  
  <p>I am passing <code>Height =100px ; and width = 300px</code>.<br/><br/> if i pass the height size 100 than width not change to 300px </p>
  
  <p>Here is code : </p>
  
  <pre><code>    AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
      previewLayer.frame = CGRectMake(20, 50, 300, 100);
      self.view.frame=CGRectMake(20, 50, 300, 100);
  
  
      CGRect layerRect = [[[self view] layer] bounds];
      [previewLayer setBounds:layerRect];
      [previewLayer setPosition:CGPointMake(CGRectGetMidX(layerRect),CGRectGetMidY(layerRect))];
      [[[self view] layer] addSublayer:previewLayer];
      [previewView.layer addSublayer:previewLayer];
  </code></pre>