pc13
pc13

Reputation: 75

Swift: background color is changed when presenting view controller modally

I'm presenting a MFMessageComposeViewController modally from a view controller. The parent controller has black background and light status bar style. When MFMessageComposeViewController is presented, the parent controller background and status bar style change.

The first image shows the top area of the parent controller before presenting MFMessageComposeViewController. The second shows the top area of parent controller when MFMessageComposeViewController is presented. I tried changing multiple settings, eg. tint color and background color for the navigation controller holding the parent controller but none works. My knowledge is very basic so chances are I'm misunderstanding very basic Swift concepts.

enter image description here

enter image description here

Upvotes: 2

Views: 1853

Answers (1)

Tomas Jablonskis
Tomas Jablonskis

Reputation: 4376

You probably have set your UIWindow background colour to white. Try making it transparent in AppDelegate before window?.makeKeyAndVisible() or remove it completely:

self.window?.backgroundColor = UIColor.white.withAlphaComponent(0)

Upvotes: 7

Related Questions