0

開發MFMailComposeViewController以在ios 5 Simulator上的導航欄上定製titleView,但它不起作用。 目前它具有Xcode 4.2,並且在iOS 4上部署時,它可以正常工作,但不會在iOS 5上。 如何解決此問題,因爲該方法尚未解析?自定義MailComposeViewController導航欄不在iOS 5中工作

MFMailComposeViewController* mailComposeViewController = [[MFMailComposeViewController alloc] init]; 
     mailComposeViewController.mailComposeDelegate = self; 
     mailComposeViewController.navigationBar.tintColor = [UIColor colorNavTint]; 
     mailComposeViewController.navigationBar.topItem.titleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]] autorelease]; 

回答

1

嘗試:

mailComposeViewController.navigationController.navigationBar.tintColor = [UIColor colorNavTint]; 
mailComposeViewController.navigationController.navigationBar.topItem.titleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]] autorelease]; 

編輯: 試試這個: mailComposeViewController.navigationController.navigationItem.titleView=[[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]] autorelease];

+0

它不工作!即使對於tintColor它也會消失! – Change 2012-03-09 18:59:25

+0

@Change查看編輯.. – Snowman 2012-03-09 19:05:23

+0

Nopes。它仍然不起作用! – Change 2012-03-09 19:12:59