views:

4486

answers:

4

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???

A: 

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 :)

Not sure your app will be approved if you do this.
Grouchal
This is no problem with Apple. This is exactly what I've done in my app (well, actually, a subclass of UINavigationBar), and it was approved by Apple (official Dave Matthews Band app). There's nothing wrong with intercepting drawInRect: to achieve a custom UINavigationBar look.
LucasTizma
+1  A: 

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

swegi
+4  A: 

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

[[picker navigationBar] setTintColor:[UIColor redColor]];
Aral Balkan
A: 

You can also try this code....

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

Ramesh