0

我正在使用MFMailComposeViewController来撰写邮件并在我的应用中添加附件。无法为MFMailComposeViewController设置默认背景图像

我有了这个代码在我AppDelegate.m

[[UINavigationBar appearance] setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 
[[UINavigationBar appearance] setShadowImage:[UIImage new]]; 
[[UINavigationBar appearance] setTranslucent:NO]; 
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0x0A/255.0f green:0x13/255.0f blue:0x1A/255.0f alpha:1]]; 

然后,我用这个代码来创建另一个UIViewController

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

[mailViewController.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; 

mailViewController.mailComposeDelegate = self; 
[self presentViewController:mailViewController animated:YES completion:nil]; 

然而MFMailComposeViewController,在MFMailComposeViewControllerUINavigationBar暗,在呈现之前它怎么没有“重置”到我指定的背景?它继承了当前的颜色UIViewController

+0

由于您将背景图像设置为零,所以很暗。你想要什么? –

+0

@JasonNam以为我在某处读到它会将颜色重置为默认值。这是我的目标,让它看起来就像在编写 – Erik

+0

时在本地邮件应用程序中显示的那样。您可以将nil分配给tintColor而不是背景图像。 –

回答

0

Set UINavigationBar's barTintColor to nil。它将删除自定义色调颜色。

+0

嗯,仍然无法正常工作。它看起来像黑暗 – Erik