Some times we face problem with Camera view aspect ratio in ios. Solution to this problem is here..
Set its aspect ratio property to AVLayerVideoGravityResizeAspectFill. It actually preserve aspect ratio; fill layer bounds.
    AVLayerVideoGravityResizeAspectFill may be used when setting the videoGravity
                property of an AVPlayerLayer or AVCaptureVideoPreviewLayer instance.
Here are two line code use.
AVCaptureVideoPreviewLayer *captureVideoPreviewLayer;    
captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
Happy Coding!!!
                       
                    
0 Comment(s)