相关疑难解决方法(0)

在iOS 7上更改MFMailComposerViewController中的导航按钮颜色

我正在尝试更改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];
Run Code Online (Sandbox Code Playgroud)

但这在iOS 7上不起作用,看起来总是这样: 在此输入图像描述

我也尝试tintColor在navigationBar上设置属性,但这也没有效果:

navigationBar.tintColor = [UIColor redColor];
Run Code Online (Sandbox Code Playgroud)

无论如何在iOS 7上更改MFMailComposeViewController中的导航按钮文本颜色?

uiappearance ios7 mfmailcomposeviewcontroller

19
推荐指数
2
解决办法
1万
查看次数