3

In my application my navigation bar color is blue.

While opening MFMessageComposeViewController its cancel button color is also blue so user is not able to see cancel button.

Cancel button is performing action, i cam dismiss MFMessageComposeViewController by clicking it.

Is there any way i can change cancel button color other than blue?

Raptor
  • 53,206
  • 45
  • 230
  • 366

3 Answers3

1

try this code.

MFMailComposeViewController* mailViewController = [[MFMailComposeViewController alloc] init];        
mailViewController.mailComposeDelegate = self;
[mailViewController setToRecipients:@[@"email@apple.com"]];

[mailViewController.navigationBar setTintColor:[UIColor orangeColor]];

[self presentViewController:mailViewController animated:YES completion:nil]; 
SGDev
  • 2,256
  • 2
  • 13
  • 29
0

chagning tintColor of navigationBar should work

MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
messageController.navigationBar.tintColor = [UIColor whiteColor]; 
Suhit Patil
  • 11,748
  • 3
  • 50
  • 60
  • How can i set the navigation bar color in case of presenting MFMessageComposeViewController ?? – Ali Nov 02 '15 at 13:06
  • [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]]; try this before initialising MFMessageComposeViewController – Suhit Patil Nov 03 '15 at 03:48
0

Just do this on the application:didFinishLaunchingWithOptions: or just before instantiating your controller

[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
user2387149
  • 1,219
  • 16
  • 28