ios - AVCaptureVideoPreviewLayer Change to AspectFill -
i session
shown in aspectfill way inside avcampreviewlayer
. while code below that, fills full screen not view preview layer hooked on storyboard. in way fill avcapturevideopreviewlayer
bounds of previewview
not full screen when changing gravity
.
[(avcapturevideopreviewlayer *)[[self previewview] layer] setvideogravity:avlayervideogravityresizeaspectfill];
i have tried
- (void)setsession:(avcapturesession *)session { ((avplayerlayer *)[self layer]).videogravity = avlayervideogravityresizeaspectfill; ((avplayerlayer *)[self layer]).bounds = ((avplayerlayer *)[self layer]).bounds; [(avcapturevideopreviewlayer *)[self layer] setsession:session]; }
** note come apple docs
Comments
Post a Comment