我有設置欄色調的顏色,當該應用程序啓動一個示例項目:UIDocumentInteractionController不尊重在IOS UINavigationBar的的barTintColor外觀11
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().barTintColor = UIColor.red
return true
}
它具有1個視圖控制器(一個UINavigationController的內部),帶這個代碼在它:
@IBAction func launchDocument(_ sender: Any) {
if let url = Bundle.main.url(forResource: "example", withExtension: "pdf") {
let controller = UIDocumentInteractionController(url: url)
controller.delegate = self
controller.presentPreview(animated: false)
}
}
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
在iOS系統10,主視圖控制器和UIDocumentInteractionController具有紅色導航欄。在iOS 11中,UIDocumentInteractionController不是紅色的。這是iOS 11的錯誤嗎?還是有另一種方法來做到這一點?
P.S. - 我知道我可以在代理中返回self.navigationController,但是我需要UIDocumentInteractionController有一個「完成」按鈕,而不是「返回」按鈕
有什麼解決方案嗎? –