2017-06-15 48 views
0

當使用導航控制器正在推動CaptureController時,攝像頭預覽始終爲縱向。進行風景拍攝時不會反映相機預覽。但是,當它只是一個「自我呈現」時,就像示例項目一樣。如何在方向爲橫向時進行操作,並且相機預覽也是橫向。捕獲的圖像具有正確的方向,只是相機預覽。從CosmicMind-Material捕獲API:攝像頭預覽不正確

Lanscape但攝像頭預覽orientaion是波泰特 - 樣圖附: link here

回答

0

解決了!此行解決這個問題:

(capture.preview.layer as! AVCaptureVideoPreviewLayer).connection.videoOrientation = videoOrientation 

只要把它委託函數

func capture(capture: Capture, didChangeFrom previousVideoOrientation: AVCaptureVideoOrientation, to videoOrientation: AVCaptureVideoOrientation)