UIDocumentPickerViewController - 隐藏位置按钮
问题描述:
我正在开发具有导入从提供UIDocumentPickerViewControllerExtenstion选择该文件,但没有在顶部左侧我想删除这个位置按钮其他云资源的音频文件的功能的应用程序。下面UIDocumentPickerViewController - 隐藏位置按钮
是我的代码:
let menupicker = UIDocumentMenuViewController(documentTypes: [kUTTypeAudio as String], in: .import)
menupicker.delegate = self
self.present(menupicker, animated: true, completion: nil)
func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
documentPicker.delegate = self
documentPicker.navigationItem.leftBarButtonItem = nil
self.present(documentPicker, animated: true) {
documentPicker.navigationItem.leftBarButtonItem = nil
documentPicker.navigationItem.backBarButtonItem = nil
documentPicker.navigationItem.hidesBackButton = true
}
}
答
我正在寻找同样的解决方案,但不能。根据我的理解,这是不可能的。 如果您遍历UIDocumentPickerViewController,它实际上有型“_UIResilientRemoteViewContainerViewController”
let picker = UIDocumentPickerViewController(documentTypes: supportDocTypes, in: .import)
picker.delegate = self
present(picker, animated: true) {
print(picker.childViewControllers) // you will get something like this: [<_UIResilientRemoteViewContainerViewController: 0x102e956c0>]
}
这是无法访问的子视图控制器,我们可以但是通过它循环访问它,你最终会得到一些其他私人组件如_RemoteView。