0
當我使用UIActivityViewController與WhatsApp共享文本時,共享的第二個屏幕具有錯誤的按鈕顏色。第一個屏幕是確定的。這個問題已經討論了很多的時間和答案的一個很大的水桶可以在這裏找到:當通過UIActivityViewController與WhatsApp共享時,按鈕中的textColor錯誤
- MFMailComposeViewController
- 並在第一屏幕時:Cannot set text color of Send and Cancel buttons in the mail composer when presented from the UIActivityViewController in iOS7
答案修復我的按鈕顏色分享到 Whatsapp
但由於某種原因不是第二個。
此爲第一個屏幕的修補程序:
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor whiteColor]];
但是,即使將所有UIBarButtonItems的外觀不工作:
[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
示例代碼不工作:
self.window?.tintColor = UIColor.white
let activityController = UIActivityViewController.init(activityItems: items, applicationActivities: nil)
if let vc = delegate?.currentViewController() {
sender.isEnabled = false
vc.present(activityController, animated: true, completion: {
sender.isEnabled = true
})
activityController.navigationController?.navigationBar.tintColor = UIColor.white
activityController.view.tintColor = UIColor.white
屏幕截圖:
第一個屏幕(OK) 第二個屏幕(不正常) 股份通過e-mail(OK)
不工作。我已經添加了代碼我測試了 –
@SjoerdPerfors這也可能是第三方會覆蓋此設置的問題。 –