2017-08-01 103 views
2

我正在開發具有導入從提供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 
    } 
} 

enter image description here

回答

0

我正在尋找同樣的解決方案,但不能。根據我的理解,這是不可能的。 如果您遍歷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。