Orientation deprecated in iOS 6

前端 未结 3 1335
轻奢々
轻奢々 2021-01-06 03:01

Looks like orientation for avcapturevideopreviewlayer has been depreciated in iOS 6. Anyone know the new code? Here is my current (depreciated) code:

[self s         


        
3条回答
  •  猫巷女王i
    2021-01-06 03:16

    Did you check the documentation? It's only one line:

    The layer’s orientation. (Deprecated in iOS 6.0. Use videoOrientation (AVCaptureConnection) instead.)

    so use:

    [[AVCaptureVideoPreviewLayer connection] setVideoOrientation: AVCaptureVideoOrientationLandscapeRight];
    

    or

    AVCaptureVideoPreviewLayer.connection.videoOrientation= AVCaptureVideoOrientationLandscapeRight;
    

提交回复
热议问题