Chris Allinson
Chris Allinson

Reputation: 1872

Present UINavigationController as modal, status bar issue

I'm trying to present a nav controller (within a vc) as a modal like so:

let myNavController = UINavigationController(rootViewController: someVc)

self.present(myNavController, animated: true)

I'm noticing that it isn't full screen ... the status bar area is black on my 5S device, and on iPhoneX there is similar black space at the top.

It seems like the modal snugs up against the bottom of the status bar's area.

Is there something I need to do to set this space to white? i.e. adjust the status bar style? Extend edge settings?

5S:

enter image description here


iPhoneX:

enter image description here

Upvotes: 0

Views: 407

Answers (1)

Chris Allinson
Chris Allinson

Reputation: 1872

It seems that the UINavigationController.navigationBar was being set to "transparent"!

self.navigationController?.navigationBar.isTranslucent = false

^ fixed the issue!

Upvotes: 1

Related Questions