我正在尝试更改MFMailComposerViewController中导航按钮的文本颜色,但它在iOS6上不像那样起作用。在iOS 6中,可以使用UIAppearance实现如下效果:
// Navigation button
UIBarButtonItem *barButton = [UIBarButtonItem appearance];
NSDictionary *barButtonTitleTextAttributes = @{UITextAttributeTextColor: [UIColor redColor]};
NSDictionary *disabledBarButtonTitleTextAttributes = @{UITextAttributeTextColor: [UIColor grayColor]};
[barButton setTitleTextAttributes:barButtonTitleTextAttributes forState:UIControlStateNormal];
[barButton setTitleTextAttributes:disabledBarButtonTitleTextAttributes forState:UIControlStateDisabled];
[barButton setBackgroundImage:[[UIImage imageNamed:@"btn_appearance"] stretchableImageWithLeftCapWidth:6 topCapHeight:0] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
但是在iOS 7上这并不起作用,看起来总是像这样:
我也尝试在navigationBar上设置tintColor属性,但这也没有任何效果:
navigationBar.tintColor = [UIColor redColor];
在iOS 7上,是否有任何方法可以更改MFMailComposeViewController中导航按钮文本的颜色?