It is not possible to set the text color of the Send and Cancel buttons in the mail composer if it is present in the UIActivityViewController in iOS10

I am using UIActivityViewController to share items in iOS10. When I click the Mail button, it gives out the mail composer, but the Cancel and Send buttons on the navigation bar and the navigation bar itself are blue, which makes it very difficult to read, so I want to change their color. Same thing with SMS exchange. I tried this

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

and this one

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

and this one

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

and this one

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

but nothing works. I even tried subclasses UIActivityViewController, but the method - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completionnever called.
I do not know what to do next. Any help is appreciated.

+4
1
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal];
0

Source: https://habr.com/ru/post/1666837/


All Articles