在我的視圖控制器我有以下代碼更改導航欄色調顏色,而在iOS的4.x中呈現新的視圖控制器模態
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSLog(@"%s",__PRETTY_FUNCTION__);
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:201.0/255.0 green:201.0/255.0 blue:201.0/255.0 alpha:1.0];
}
在這種觀點看來,當我點擊一個按鈕,我提出MFMailComposeViewController
模態。當我以模態方式呈現MFMailComposeViewController
時,導航欄與viewWillAppear
中設置的顏色相同。我想要默認的藍色,因爲蘋果告訴你不要自定義這個視圖。這裏是我的代碼,我已經試過
代碼1:viewWillDisappear
-(void)viewWillDisappear:(BOOL)animated {
NSLog(@"%s",__PRETTY_FUNCTION__);
self.navigationController.navigationBar.tintColor = nil;
[super viewWillDisappear:animated];
}
設置色調顏色:
-(void)sendEmailWithWithRecipients:(NSArray*)recipients andData:(NSData*)data {
if ([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *mailComposeViewController = [[MFMailComposeViewController alloc] init];
mailComposeViewController.mailComposeDelegate = self;
self.navigationController.navigationBar.tintColor = nil;
[self presentModalViewController:mailComposeViewController animated:YES];
[mailComposeViewController release];
}
else {
[self showAlertWithTitle:@"Alert" andMessage:@"Can not send email. Please check your email settings."];
}
}
但上面的代碼是不工作的淺顏色
碼2代碼2也不起作用。
但這是iOS5中沒有做工精細設置tintColor = nil
而在viewWillDisappear
呈現MFMailComposeViewController
模態&。它不工作的iOS 4.x
任何人都有這個解決方案?謝謝。
你不想只更改tintColor或您的導航欄 – 2012-04-26 16:00:45
@ R.A的全背景色彩我想默認的導航欄時,我提出mailComposeViewController模態 – iOSAppDev 2012-04-27 04:15:34