Managed to change the text color of the Send and Cancel buttons, which are on the UINavigationBar
in the MFMailComposerViewController
(both Send and Cancel) and MFMessageComposeViewController
(only Cancel), when presented from UIActivityViewController
.
Using an UIActivityViewController, tap on Message
or Mail
:
You’ll notice that the default text color of the Send and Cancel buttons is blue:
In order to change that, in the AppDelegate.m
class, in the didFinishLaunchingWithOptions
method, insert the following line:
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor whiteColor]];
This results in:
You can also use other colors, for example:
[UIColor purpleColor];
[UIColor greenColor];
How did I test this? I noticed this solution works for the following:
- with Xcode 5.1, in the iOS 7.1 simulator, building as base iOS SDK 7.1 (can be chosen from selecting the project file -> Build Settings -> Base SDK. Also, selected from General -> Deployment Target -> 7.1)
- with Xcode 5.1, on an iPhone 4, building as base iOS SDK 7.0 (can be chosen from selecting the project file -> Build Settings -> Base SDK. Also, selected from General -> Deployment Target -> 7.0)
- with Xcode 5.1, on an iPhone 4, building as base iOS SDK 7.1 (can be chosen from selecting the project file -> Build Settings -> Base SDK. Also, selected from General -> Deployment Target -> 7.1)
It didn’t work when testing with:
- with Xcode 5.1, in the iOS 7.0 simulator, building as base iOS SDK 7.0 (can be chosen from selecting the project file -> Build Settings -> Base SDK. Also, selected from General -> Deployment Target -> 7.0)
Therefore it should be safe to use, as I believe the behavior on the actual device matters more than the behavior in the iOS simulator.
If anyone knows why it doesn’t work in the iOS 7.0 simulator, I would like to know. 🙂