user1451163 user1451163 - 1 year ago 122
Objective-C Question

Change main title color of navigation in MFMailComposeViewController

I haven't problem for change color of main title of navigation on a normal viewController but on a MFMailComposeViewController, it isn't possible.
I can change colors of buttons (cancel and send), I can set background of navigation bar but not possible to change color of title. I don't want set a new title (apparently, it's not allow by Apple), I just want change the color :'(

Please help me.

Answer Source
NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                            [UIColor whiteColor],UITextAttributeTextColor, 
                                            [UIColor blackColor], UITextAttributeTextShadowColor, 
                                            [NSValue valueWithUIOffset:UIOffsetMake(-1, 0)], UITextAttributeTextShadowOffset, nil];

[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];


navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor yellowColor] forKey:UITextAttributeTextColor];

Hope its work for you..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download