Question

I am doing update on of the project that was done 2 years back using nib files.

I see for navigation image, he have used

-(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 ;
}

For email he have

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];

I tried to hide navigation bar using

self.navigationController.navigationBar.backIndicatorImage = [UIImage imageNamed:@"text_field.png"];
self.navigationController.navigationBar.backgroundColor = [UIColor whiteColor];

self.navigationController.navigationBar.hidden = YES:

Also replaced self.navigationController with picker.navigationController

Still nothing...

How can I hide this menu? While sending, client don't want to see navigation. He want plain white screen or blue navigation as iOS 7/6 standard.

Any idea how to get this done for nib files?

Was it helpful?

Solution

Sometimes UGLY is better way then NOTHING...

While sending I added below code...

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

I am creating top bar with white background... :D :P

And in didFinishWithResult I switched back to original

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

Ugly way, but can't handle it.

Note: For iOS 6, top_bar_bgwhite.png will be top_bar_bgblue.png

OTHER TIPS

you can try to set back image to MFMailComposeViewController only with

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

and to make any manipulations with UINavigationBar of MFMailComposeViewControllerm you need to call soothing like self.navigationBarHidded = YES; cause MFMailComposeViewController inherits from UINavigationController directly, you don't need to access via self.navigationController

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top