Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone iOS-从MFMailComposeViewController中删除UIImageView_Iphone_Objective C_Ios_Cocoa Touch_Uinavigationcontroller - Fatal编程技术网

Iphone iOS-从MFMailComposeViewController中删除UIImageView

Iphone iOS-从MFMailComposeViewController中删除UIImageView,iphone,objective-c,ios,cocoa-touch,uinavigationcontroller,Iphone,Objective C,Ios,Cocoa Touch,Uinavigationcontroller,我的ViewController有一个带有Promt的navigationBar,我在上面添加了一个自定义图像: - (void)changeNavBar { UIImage *image = [UIImage imageNamed: @"logo_home.png"]; imageView = [[UIImageView alloc] initWithImage:image]; imageView.contentMode = UIViewContentModeLeft;

我的
ViewController
有一个带有Promt的
navigationBar
,我在上面添加了一个自定义图像:

- (void)changeNavBar
{
    UIImage *image = [UIImage imageNamed: @"logo_home.png"];
    imageView = [[UIImageView alloc] initWithImage:image];
    imageView.contentMode = UIViewContentModeLeft;

    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"logo_home.png"] forBarMetrics:UIBarMetricsDefault];

    imageView.frame = CGRectMake(0, 0, 320, 70);

    [self.navigationController.navigationBar insertSubview:imageView atIndex:0];

    self.navigationController.navigationBar.backItem.backBarButtonItem.tintColor = [UIColor blackColor];
}
但当用户单击“发送电子邮件”按钮时,我会创建
MFMailComposeViewController
,并以模式显示它

- (IBAction)emailPressed:(id)sender
{
    NSString *emailTitle = event.title;
    NSString *messageBody = [NSString stringWithFormat:@"%@ - %@", event.title, event.concertUrl.absoluteString];

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

    mc.mailComposeDelegate = self;
    NSLog(@"subviews: %d", mc.navigationBar.subviews.count);

    [mc setSubject:emailTitle];
    [mc setMessageBody:messageBody isHTML:NO];

    // Present mail view controller on screen
    [self presentModalViewController:mc animated:YES];
}

MFMailComposeViewController
的导航栏自动调整为正常导航栏,无需提示,但我以前的VC中的自定义图像不会消失。如何删除它并将标准黑色样式设置为我的导航栏?

您已使用UIAppearance proxy设置背景图像,这将对应用程序中的每个导航栏产生影响

改变

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"logo_home.png"] forBarMetrics:UIBarMetricsDefault];

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"logo_home.png"] forBarMetrics:UIBarMetricsDefault];