无法为MFMailComposeViewController设置默认背景图像

时间:2015-12-31 20:11:59

标签: ios objective-c uinavigationcontroller uinavigationbar 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]];

然后我使用此代码在另一个MFMailComposeViewController中创建UIViewController

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

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

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

然而,UINavigationBar中的MFMailComposeViewController是黑暗的,它怎么会重置"重置"在呈现之前我指定的背景本身?它是继承当前UIViewController的颜色吗?

1 个答案:

答案 0 :(得分:0)

var myregexp = /=(\S*)/g; var match = myregexp.exec("FirstEvictionActionDate=11/20/2014 12:00:00 AM SuspensionCode=123"); while (match != null) { //for (var i = 0; i < match.length; i++) { alert((match[1])); //} match = myregexp.exec("FirstEvictionActionDate=11/20/2014 12:00:00 AM SuspensionCode=123"); } 的{​​{1}}设为UINavigationBar。它将删除自定义色调。