How to change the color of MFMailComposeViewController texts and button images?

iOS uses the standard (blue) color cast for all color texts in the MFMailComposeViewController. This is not good for me, as the client wants his company color in the application. How to change color to orange?

I specifically ask about the colors of the button icons (add the image and the image of the bell) and texts containing mail addresses. I have already changed the colors of the navigation bars. The documentation says:

The presentation hierarchy of this class is private, and you should not modify it. However, you can customize the appearance of the instance using the UIAppearance protocol.

I tried to use it, but it does not work (I can do it wrong, since I do not know UIAppearance). This is what I tried:

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

enter image description here

+6
source share
1 answer

As Apple says: https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMailComposeViewController_class/index.html

The presentation hierarchy of this class is private and you must not modify this. However, you can customize the appearance of the instance using the UIAppearance protocol.

In any case, you can check this message: Configure MFMailComposeViewController to start automatically from a UITextView

+1
source

Source: https://habr.com/ru/post/985597/


All Articles