自定义MailComposeViewController导航栏在iOS 5中不起作用



正在开发MFMailComposeViewController,以便在ios 5 Simulator的导航栏上具有自定义标题View,但它不起作用。目前它有Xcode 4.2,当部署在iOS 4上时,它可以正常工作,但不能在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];

尝试:

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

最新更新