微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

MFMailComposeViewController栏的背景颜色在iOS7中不变

我试图在iOS7中更改MFMailComposeViewController的背景颜色,但是我无法使其工作.

我使用以下剪辑:

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;

if([picker.navigationBar respondsToSelector:@selector(barTintColor)]) {
    // iOS7
    picker.navigationBar.barTintColor = READER_NAVIGATION_BAR_BACKGROUND_COLOR;
    // Set back button arrow color
    [picker.navigationBar setTintColor:READER_NAVIGATION_BAR_BACK_BUTTON_ARROW_COLOR];

    // Set Navigation Bar Title Color
    [picker.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObject:READER_NAVIGATION_BAR_TITLE_norMAL_FONT_COLOR forKey:UITextAttributeTextColor]];

    // Set back button color
    [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class],nil] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:READER_NAVIGATION_BAR_BUTTONS_FONT_COLOR,UITextAttributeTextColor,nil] forState:UIControlStatenormal];

}

有没有人知道如何更改iOS7中MFMailComposeViewController的bakcground颜色?

解决方法

尝试这个.为我工作

MFMailComposeViewController* myailViewController = [[MFMailComposeViewController alloc] init];
// set other attributes of mailcomposer here.
myMailViewController.mailComposeDelegate = self;

[myMailViewController.navigationBar setTintColor:[UIColor whiteColor]];

[self presentViewController:myMmailViewController animated:YES completion:nil];

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐