MFMailComposeViewController栏背景颜色在iOS7中没有变化 [英] MFMailComposeViewController bar background color not changing in iOS7

查看:148
本文介绍了MFMailComposeViewController栏背景颜色在iOS7中没有变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 iOS7 更改 MFMailComposeViewController 的背景颜色,但我无法正常工作。

I'm trying to change the background color of the MFMailComposeViewController in iOS7 but I cannot make it work.

我正在使用以下剪辑:

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];

} 

有谁知道如何改变<的bakcground颜色在iOS7中code> MFMailComposeViewController ?

推荐答案

试试这个。为我工作。

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];

这篇关于MFMailComposeViewController栏背景颜色在iOS7中没有变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆