MFMailComposeViewController Bar titleText and UIbarbuttons do not use custom font provided by external proxy

I changed the look of UIBarButtonItem and UINavigationBar titleTextAttributes to my custom font along with color on white using the Appearance proxy in the applicationDidFinishLaunching application. Each navigation header text and BarButtonItems use a special font.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false) UINavigationBar.appearance().barStyle = UIBarStyle.BlackTranslucent UINavigationBar.appearance().barTintColor = NSFontAttributeName:SharedHelper.myCustomBarColor() UINavigationBar.appearance().titleTextAttributes =[NSForegroundColorAttributeName:UIColor.whiteColor()] UIBarButtonItem.appearance().tintColor = UIColor.whiteColor() let attributes = [NSFontAttributeName:SharedHelper.customFontForBarButton()] UIBarButtonItem.appearance().setTitleTextAttributes(attributes, forState: UIControlState.Normal) return true } 

The problem occurs when I use MFMailComposeViewController to send email. MFMailComposeViewController ignores font attributes and reverts to default fonts. In the iPhone 5S simulator, I sometimes see a custom font, but it reverts to the standard font.

enter image description here

Some time shown in the iPhone Simulator 5S. (I'm trying to do this)

enter image description here

The default font is used after a few seconds.

Any help on this? Should the appearance proxy work for both the UIBarButton and NavigationBar MFMailComposeViewController, or does encoding need to do this?

I am using Swift, and also trying to use Alexander's WenContainedIn appearance using Bridge, but it doesn't seem to work. I am worried about changing the font titleText and BarButtonItems (cancel, send) MFMailComposeViewController.

Thanks in advance. Any help would be greatly appreciated.

+5
source share
1 answer

I have been dealing with the same issue with iOS 9 devices for the past few days. I tried almost everything. However, this morning I will try to add the following to AppDelegate:

 UIBarButtonItem.appearanceWhenContainedInInstancesOfClasses([MFComposeViewController.self]).setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.blueColor()], forState: .Normal) 

I can not use the UINavigationBar class, as this will affect the whole appearance of the application, and this is not what I want.

I will send a message if it works.

0
source

All Articles