gpt4 book ai didi

ios - 如何翻译 UIImagePickerController 预览?

转载 作者:行者123 更新时间:2023-11-28 16:16:07 25 4
gpt4 key购买 nike

当我打开 UIImagePickerController() 并设置 showsCameraControls = false 时,相机预览位于屏幕顶部。如何向下移动此预览,使其与 showCameraControls = true 时的位置相同?

最佳答案

在网上拖网时找到了答案:

// 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
// ...

关于ios - 如何翻译 UIImagePickerController 预览?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39067666/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com