Patroclus
Patroclus

Reputation: 1232

navigationBar.IntrinsicContentSize.height doesn't match the actual bar's size

I tried to set the position of a component by using CGRect containing the position.

 pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRect(x:0.0, y:(self.navigationController?.navigationBar.intrinsicContentSize.height)!, width:self.view.frame.width, height:self.view.frame.height), pageMenuOptions: parameters)

and y is set to self.navigationController?.navigationBar.intrinsicContentSize.height

But when I run my app on the simulator, it shows the menu bar underneath the navigation bar. I don't know why. I already set the y coordinate to the height of navigation bar. Please help.

enter image description here

And this is my StoryBoard.

enter image description here

Upvotes: 2

Views: 324

Answers (1)

mag_zbc
mag_zbc

Reputation: 6982

Set this for the view controller that hides under the navigation bar

viewController.edgesForExtendedLayout = []

Upvotes: 1

Related Questions