5

I have an issue with customizing the appearance of the MFMailComposeViewController on iOS 13.

My application uses a dark navigation bar and white tint on items in the bar.

    UINavigationBar.appearance().tintColor = BrandManager.globals.textColor
    UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UINavigationBar.appearance().tintColor]
    // navBar color for app
    UINavigationBar.appearance().barTintColor = BrandManager.primaryColors.background
    // navBar color for some sharing containers…except MFMessageComposeVC & SLComposeVC (twitter)
    UINavigationBar.appearance().backgroundColor = BrandManager.primaryColors.background
    // navBar color for MFMessageComposeVC & SLComposeVC
    UINavigationBar.appearance().setBackgroundImage(UIImage(color: BrandManager.primaryColors.background), for: .default)

    UIBarButtonItem.appearance(whenContainedInInstancesOf: [UINavigationBar.self]).tintColor = BrandManager.globals.textColor

This worked in iOS 12 and prior.

For iOS 13, I'm getting the following, very strange behavior, where the bar button items are white, the title text is black, and scrolling up produces this strange translucent white on the correct navigation bar color.

image showing how scrolling affects the view controller

I have tried every combination I can think of for the UIBarButtonItem appearance but nothing seems to work. Most other solutions I've found aren't related to iOS 13.

Stephen Furlani
  • 6,794
  • 4
  • 31
  • 60
  • I also came across this same [behavior](https://stackoverflow.com/q/58656920/1077789). – Isuru Nov 01 '19 at 10:52

0 Answers0