0

我正在對2年前使用nib文件完成的項目進行更新。從MFMailComposeViewController刪除導航圖像

我看到導航的形象,他已使用

-(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 =是:

也換成self.navigationControllerpicker.navigationController

還是什麼都沒有......

我怎麼能隱藏這個菜單?在發送時,客戶端不希望看到導航。他想要iOS 7/6標準的普通白色屏幕或藍色導航。

任何想法如何完成這個筆尖文件?

回答

0

有時醜更好的方式則沒什麼......

雖然我發送添加下面的代碼...

[[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.pngtop_bar_bgblue.png

0

你可以嘗試圖像設置回MFMailComposeViewController只

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

並與MFMailComposeViewControllermUINavigationBar進行任何操作,你需要調用舒緩像self.navigationBarHidded = YES;原因MFMailComposeViewController直接繼承自UINavigationController,您不需要通過self.navigationController訪問