0
我ViewController
有PROMT一個navigationBar
,並在它上面我已經添加了自定義圖像刪除的UIImageView:iOS版 - 從MFMailComposeViewController
- (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
的導航欄autoresizes正常的導航欄沒有提示,但以前的VC我的自定義圖像也不會消失。我怎樣才能刪除它,並將標準黑色風格設置爲我的導航欄?
工作!謝謝! :-) – Oleg