当我打开UIImagePickerController()
并设置showsCameraControls = false
时,相机预览位于屏幕顶部。如何向下移动此预览,使其与showCameraControls = true
时的位置相同?
答案 0 :(得分:1)
在网上拖网时找到答案:
// Create the UIImagePickerController without camera controls
var imagePicker: UIImagePickerController = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = .Camera
imagePicker.allowsEditing = false
imagePicker.showsCameraControls = false
// Translate the camera preview down by 50px
let translate: CGAffineTransform = CGAffineTransformMakeTranslation(0.0, 50.0)
imagePicker.cameraViewTransform = translate
// Now add custom overlay
// ...