我正在尝试更改 MFMailComposerViewController 中导航按钮的文本颜色,但它不像在 iOS 6 上那样工作。在 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 上不起作用,并且看起来总是这样:
我也尝试tintColor
在 navigationBar 上设置属性,但这也没有效果:
navigationBar.tintColor = [UIColor redColor];
无论如何在 iOS 7 上更改 MFMailComposeViewController 中的导航按钮文本颜色?