uiscrollview - UIDocumentPickerViewController 滚动视图与顶部导航栏重叠
问题描述
我正在尝试以模态方式显示 UIDocumentPickerViewController。它显示,但 UIDocumentPickerViewController 内的滚动视图没有从顶部显示某些部分,我必须向下滚动才能看到内容,一旦发布,再次回到顶部。(见图)。
这就是我正在尝试的方式!
let documentPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.image", "public.audio", "public.movie", "public.text", "public.item", "public.content", "public.source-code"],
in: .import)
if #available(iOS 11.0, *) {
documentPicker.allowsMultipleSelection = true
} else {
// Fallback on earlier versions
}
self.present(documentPicker, animated: true,
completion: nil)
解决方案
将 uinavigation bar 外观全局设置为 false 解决了该问题:
UINavigationBar.appearance().isTranslucent = false
但这似乎仍然是 hack,因为它会影响 isTranslucent 需要“真实”的应用程序的其他区域。
如果有人找到更好的解决方案,请更新。:)
推荐阅读
- apache-spark - 使用 SparklyR 连接到 Spark 时出错
- regex - 如何使用正则表达式在回车和换行之前附加字符
- r - tidyverse 中是否有 R 函数可以使用代码选择列的元素?
- python - 如何使用 OpenCV 对 IP 摄像机进行身份验证
- angular - 如何构建我的 Angular 8 应用程序,以便在浏览器中打开 index.html 时它可以工作?
- c# - 在 Unity3D 中模拟真实的汽车旋转
- html - 在我的 CSS 中,网格属性无法正常运行
- sql-server - 推荐邮寄地址匹配方案?
- python - 如果两个字母变为0,如何从文件中的字符串中查找一个单词(Python 3)
- java - 无法加载驱动程序类 org.mariadb.jdbc.Driver