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?
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];
chagning tintColor
of navigationBar should work
MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
messageController.navigationBar.tintColor = [UIColor whiteColor];
只需在application:didFinishLaunchingWithOptions:
上执行此操作application:didFinishLaunchingWithOptions:
或者在实例化控制器之前执行此操作
[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.