解决方法
您需要使用AVCaptureVideoPreviewLayer的videoGravity属性.
看看doc.你需要使用:AVLayerVideoGravityResizeAspectFill@H_301_3@
编辑:@H_301_3@
- (void)setSession:(AVCaptureSession *)session { ((AVPlayerLayer *)[self layer]).videoGravity = AVLayerVideoGravityResizeAspectFill; ((AVPlayerLayer *)[self layer]).bounds = ((AVPlayerLayer *)[self layer]).bounds; [(AVCaptureVideoPreviewLayer *)[self layer] setSession:session]; }