在UIViewControllerRepresentable中使用VNDocumentCameraViewController时,如何将相机扫描视图扩展到safa区域?
以下是代码
struct ScanDocumentView: UIViewControllerRepresentable {
func makeCoordinator() -> Coordinator {
Coordinator(recognizedText: $recognizedText, parent: self)
}
func makeUIViewController(context: Context) -> VNDocumentCameraViewController {
let documentViewController = VNDocumentCameraViewController()
documentViewController.delegate = context.coordinator
return documentViewController
}
func updateUIViewController(_ uiViewController: VNDocumentCameraViewController, context: Context) {
// nothing to do here
}
}下面是底部安全区域为空的行为

发布于 2021-01-19 13:30:02
问题解决了!只需添加
.ignoresSafeArea()在……下面
ScanDocumentView()仅此而已
https://stackoverflow.com/questions/65750820
复制相似问题