I want to customize MFMessageComposeViewController
with a specific image for the navigation bar and a simple white color for status bar, navigation bar's title and cancel button. The only thing I can't do is to change the cancel button's color. Here is my implementation:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBar.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
MFMessageComposeViewController *sms = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]){
sms.body = string;
sms.recipients = number;
sms.messageComposeDelegate = self;
[self presentViewController:sms animated:YES completion:^{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}];
}
I also try with [sms.navigationBar setTintColor:[UIColor whiteColor]];
but It doesn't work.
EDIT
I finally find a solution: just add this line of code under the last [UINavigationBar appearance]
:
[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil].tintColor = [UIColor whiteColor];