【问题标题】:remove navigation image from MFMailComposeViewController从 MFMailComposeViewController 中删除导航图像
【发布时间】:2013-12-14 13:03:24
【问题描述】:

我正在更新两年前使用 nib 文件完成的项目。

我看导航图,他用过

-(id)initWithRootViewController:(UIViewController *)rootViewController
{

    self = [super initWithRootViewController:rootViewController];
    if (self)
    {
        self.delegate = self ;
        [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"top_bar_bg.png"] forBarMetrics:UIBarMetricsDefault];
        //[self.navigationBar setTintColor:[UIColor blackColor]];
        self.navigationController.navigationBar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
    }
    return self ;
}

他有电子邮件

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"CarZone"];

// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:dealerInfo.dealerEmail]; 
[picker setToRecipients:toRecipients];
// Fill out the email body text
NSString *emailBody = @"Input your message here.";
[picker setMessageBody:emailBody isHTML:YES];
[self.navigationController presentViewController:picker animated:YES completion:^{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}];
[picker release];

我尝试使用

隐藏导航栏
self.navigationController.navigationBar.backIndicatorImage = [UIImage imageNamed:@"text_field.png"];
self.navigationController.navigationBar.backgroundColor = [UIColor whiteColor];

self.navigationController.navigationBar.hidden = YES:

还将self.navigationController 替换为picker.navigationController

还是什么都没有……

如何隐藏此菜单?发送时,客户端不想看到导航。他希望纯白屏或蓝色导航作为 iOS 7/6 标准。

知道如何为 nib 文件完成这项工作吗?

【问题讨论】:

    标签: objective-c uinavigationcontroller uinavigationbar mfmailcomposeviewcontroller


    【解决方案1】:

    有时 UGLY 比 NOTHING 更好...

    发送时我添加了以下代码...

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

    我正在创建带有白色背景的顶栏... :D :P

    didFinishWithResult我切换回原来的

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

    丑陋的方式,但无法处理。

    注意:对于 iOS 6,top_bar_bgwhite.png 将是 top_bar_bgblue.png

    【讨论】:

      【解决方案2】:

      您可以尝试将图像设置回 MFMailComposeViewController 仅使用

      [[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
      

      要使用 UINavigationBarMFMailComposeViewControllerm 进行任何操作,您需要调用像 self.navigationBarHidded = YES; 这样的安慰,因为 MFMailComposeViewController 直接继承自 UINavigationController,您不需要通过 self.navigationController 访问

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多