【问题标题】:UIDocumentPickerController does not occupy entire screen in IOS14UIDocumentPickerviewController 在 IOS 14 中不会占据整个屏幕
【发布时间】:2021-02-21 09:08:47
【问题描述】:

我正在使用以下代码导入文件,

if #available(iOS 14, *) {
        let supportedTypes: [UTType] = [UTType.text, UTType.data]
        let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: supportedTypes, asCopy: true)
        documentPicker.delegate = self
        documentPicker.modalPresentationStyle = .formSheet
       
        self.present(documentPicker, animated: true, completion: nil)
    }

在输出中,我们可以看到“最近/浏览器”标签栏和文档内容视图之间的透明视图。

这是输出的截图:

image 1 image 2

如果我将演示样式更改为全屏,透明视图将变为灰色视图

documentPicker.modalPresentationStyle = .fullScreen

这是全屏输出的截图:

image 3 image 4

有谁知道如何解决这个问题?

【问题讨论】:

    标签: ios14 uidocumentpickerviewcontroller


    【解决方案1】:

    检查UITabBar.appearance().isTranslucent 属性。 当这个属性是 false

    时我遇到了同样的问题

    【讨论】:

      猜你喜欢
      • 2022-10-06
      • 1970-01-01
      • 2021-03-11
      • 2019-11-21
      • 1970-01-01
      • 2015-06-25
      • 1970-01-01
      • 1970-01-01
      • 2021-11-03
      相关资源
      最近更新 更多