objective-c - 当从 iOS10 中的 UIActivityViewController 呈现时,无法在邮件编辑器中设置发送和取消按钮的文本颜色

标签 objective-c xcode email ios10 uiactivityviewcontroller

我正在使用 UIActivityViewController 在 iOS10 中共享项目。当我点击邮件选项时,它会弹出邮件编辑器,但是导航栏上的取消和发送按钮以及导航栏本身都是蓝色的,很难阅读,所以我想改变它们的颜色。短信共享也是如此。 我试过了

[[[controller navigationController] navigationBar] setTintColor:[UIColor blackColor]];

还有这个

[[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UINavigationBar class]]] setTintColor:[UIColor blackColor]];

还有这个

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];

还有这个

[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];  

但没有任何作用。我什至尝试子类化 UIActivityViewController 但它是方法 - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion从未调用过。
我不知道下一步该怎么做。感谢您的帮助。

最佳答案

[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal];

关于objective-c - 当从 iOS10 中的 UIActivityViewController 呈现时,无法在邮件编辑器中设置发送和取消按钮的文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41662666/

相关文章:

objective-c - NSTextField 委托(delegate)通知——如何获取文本?

ios - 创建单元格时 TableViewCell 未解析的标识符

java - 如何为带有附件的 Java MimeMessage 对象创建测试数据?

objective-c - 我应该明确释放吗?

ios - 缩放 super 层时如何不缩放 CATextLayers

ios - Xcode 嵌入式二进制文件发布与调试

java - 使用 freemarker 发送消息

Android:如何确认邮件发送成功

iphone - 如何使用ntimer显示秒?

swift - API 不支持 IPv6,应用被拒绝。我能做些什么?