Ios MFMailComposeViewController自定义导航按钮?

Ios MFMailComposeViewController自定义导航按钮?,ios,ios4,mfmailcomposeviewcontroller,Ios,Ios4,Mfmailcomposeviewcontroller,对于MFMailComposeViewController中的“取消”和“发送”按钮(barbuttonitems),使用自定义背景图像的最佳方法是什么 A/N:我知道苹果网站上关于不更改interfact的说明,但我需要这样做,以确保整个应用程序的一致性。您可以始终在后台发送电子邮件,并控制表单和电子邮件按钮的外观。看看这篇文章和如何做到这一点的答案 您可以通过app delegate自定义导航栏、取消和发送按钮的外观 请尝试以下代码: UIImage*resizedImage = [[UII

对于
MFMailComposeViewController
中的“取消”和“发送”按钮(
barbuttonitems
),使用自定义背景图像的最佳方法是什么


A/N:我知道苹果网站上关于不更改interfact的说明,但我需要这样做,以确保整个应用程序的一致性。

您可以始终在后台发送电子邮件,并控制表单和电子邮件按钮的外观。看看这篇文章和如何做到这一点的答案


您可以通过app delegate自定义导航栏、取消和发送按钮的外观

请尝试以下代码:

UIImage*resizedImage = [[UIImage imageNamed:@"navbar1"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 12, 12, 10)];
id navbar =[UINavigationBar appearance];
id barbutton =[UIBarButtonItem appearance];

//this customises the navigation bar 
[navbar setBackgroundImage:resizedImage forBarMetrics:UIBarMetricsDefault];
UIImage *backButton = [[UIImage imageNamed:@"blueButton"]  resizableImageWithCapInsets:UIEdgeInsetsMake(10 , 18, 10 , 18)];

// this customises the back bar button item in the navigation bar
[barbutton setBackButtonBackgroundImage:backButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];


// this for other bar button items 
[barbutton setBackgroundImage:backButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

这只适用于一个例外:MFMailComposeViewController似乎忽略了resizingMode参数:
[[UIBarButtonItem外观]setBackgroundImage:[[UIImage ImageName:@“btn main.png”]ResizebleimageWithCapInsets:UIEdgeInsetsMake(4.0,4.0,4.0)resizingMode:UIImageResizingModeStretch]forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]