Mugunth
Mugunth

Reputation: 14499

iPhone SDK 3.0 in-app email - changing navigation bar tint color

My App uses the iPhone SDK 3.0's new in-app email feature.

I want to change the tint color of the email UI to black and make it translucent.

I tried the following code,

/*
picker.navigationController.navigationBar.tintColor = [UIColor blackColor];
picker.navigationController.navigationBar.translucent = YES ;
*/

But it's changing the color of the view that creates,

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];

the compose window, rather than the compose window itself.

Is this atleast possible? Or should we stick to Apple provided blue itself???

Upvotes: 6

Views: 6961

Answers (5)

arango_86
arango_86

Reputation: 4425

You can also try this code....

MFMailComposeViewController *mailComposeView = [[MFMailComposeViewController alloc] init];
mailComposeView.navigationBar.tintColor = [UIColor cyanColor];

Upvotes: 0

RyeMAC3
RyeMAC3

Reputation: 1023

[[picker navigationBar] setTintColor:[UIColor blackColor]];

....makes the Cancel and Send buttons black too. They are not blue and do not change color when pressed.

Upvotes: 0

Aral Balkan
Aral Balkan

Reputation: 109

Since the MFMailComposeViewController is a subclass of UINavigationController, simply do this:

[[picker navigationBar] setTintColor:[UIColor redColor]];

Upvotes: 5

swegi
swegi

Reputation: 4102

The iPhone Human Interface Guidelines do not forbid to use custom colors but recommends the standard colors (blue and black).

Upvotes: 1

user41806
user41806

Reputation: 559

Yes it is possible.

Just add a objective-c category in the UINavigationBar class overriding the drawInRect Method. This way you can do want.

The disadvantage, all your navigation bars will change :)

Upvotes: 0

Related Questions