我正在使用 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/