Search code examples
objective-ccolorsmfmailcomposeviewcontrollertitlebarmfmessagecomposeviewcontroller

How to change MFMessageComposeViewController's Contact picker's title color and text?


I'm using MFMessageComposeViewController in my application to present the sending sms feature within the app using the following code.

MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];

Also you need to import its delegate and header file in .h file as,

#import <MessageUI/MessageUI.h>
...
@interface YourViewController : UIViewController <....., MFMessageComposeViewControllerDelegate>

The sms view controller will look like..

enter image description here

Problem:

The problem is, I used a custom color throughout my app. That color was getting reflected in this sms view controller's navigation bar color like this..

enter image description here

But I do not want to show the custom title color here. I just want to show the default one. Is it any way to change this custom title color to the default one?

Note: I added the custom navigation title color in Appdelegate's didFinishLaunchingWithOptions method


Solution

  • You can use UIAppearance appearanceWhenContainedIn and then add your classes that are applicable.