2015-04-21 38 views
6

iOS为MFMailComposeViewController中的所有彩色文本使用标准(蓝色)色调颜色。这对我并不好,因为客户希望他的公司颜色在应用程序中。如何改变他们的颜色为橙色?如何更改MFMailComposeViewController文本和按钮图像的颜色?

我在问具体颜色的按钮图标(添加图像和铃声图像)和包含邮件地址的文本。我已经更改了导航栏颜色。在文档中,写有:

此类的视图层次结构是私有的,您不得修改它。但是,您可以使用UIAppearance协议自定义实例的外观。

我试图使用它,但它不工作(我可能会这样做是错误的方式,因为我不知道UIAppearance)。这是我曾尝试:

 [[UIButton appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal]; 

     [[UILabel appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTextColor:[UIColor orangeColor]]; 

enter image description here

+1

使用tintColor这样, mailComposerViewController.view.tintColor =的UIColor whiteColor] – Sandeep

+0

属性tintColor不适用于MFMailComposeViewController – Reconquistador

+0

对不起,我的意思来看,请看看上面的编辑。 – Sandeep

回答

1

随着苹果说:https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMailComposeViewController_class/index.html

这个类的视图层次是私有的,不得修改 它。但是,您可以通过使用UIAppearance协议来自定义实例的外观。

无论如何,你可以检查这个帖子: Customizing automatic MFMailComposeViewController opened from UITextView

+0

在那篇文章中,只有信息如何更改导航栏中文本的颜色,这是我已经做的事情。 – Reconquistador

+0

是的,你是对的。你有没有尝试过? [[UINavigationBar外观] setTintColor:[UIColor redColor]]; – Bisca

+0

我不需要更改UINavigationBar的外观,因为它已经更改。 – Reconquistador

相关问题