Lena Verhoev
Lena Verhoev

Reputation: 259

Opacity only works for a moment when modally presenting a UIPageViewController

I have a modal segue to a UIPageViewController.

I would like the background of the UIPageViewController to be clear. I have set this in the viewDidLoad(), and have set the custom view controller for the page view controller to have a dark grey background with 0.98 opacity.

When the segue pops up, the 0.98 opacity works for about a second and then goes opaque.

I've tried both full screen and current context presentation styles, and tried swapping so that it's background = .clear in the custom view controller / opacity 0.98 in the page view controller.

Any ideas?

Upvotes: 0

Views: 24

Answers (1)

Lena Verhoev
Lena Verhoev

Reputation: 259

  • Changed segue presentation to automatic
  • view.backgroundColor = .clear in UIPageViewController viewDidLoad()
  • backgroundColor = .clear and opacity in the custom View Controller viewDidLoad()

Upvotes: 0

Related Questions