当我与 WhatsApp 分享短信时UIActivityViewController
就我而言,共享的第二个屏幕的按钮颜色错误。
第一屏就OK了。这个问题已经讨论过很多次了,可以在这里找到很多答案:当从 iOS7 中的 UIActivityViewController 呈现时,无法设置邮件编辑器中“发送”和“取消”按钮的文本颜色 https://stackoverflow.com/questions/19368122/cannot-set-text-color-of-send-and-cancel-buttons-in-the-mail-composer-when-prese
答案为我修复了以下按钮的颜色:
- MFMailComposeViewController
- 分享时的第一个屏幕
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
截图:
只需尝试更改 UIWindow 的tintColor
在你的Appdelegate
method didFinishLaunchingWithOptions
。然后它将作为默认值自动传递给其所有 UIView 后代。
[self.window setTintColor:[UIColor whiteColor]];
希望对你有帮助。
这也可能是第三方的问题,该第三方将(覆盖)再次设置tintColor。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)