Zhan Zhan - 1 month ago 14
Swift Question

How to fix PageMenu on ViewController Swift

I use PageMenu. I need fix menu with constraints by height. How to do this?
I know how to fix height of menu, no need answers about this. This problems with constraints AutoLayout. I need fix PageMenu on my ViewController. And app must work on different devices.
I try change Y value. but not work how I need.

pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0.0, 240.0, self.view.frame.width, self.view.frame.height), pageMenuOptions: parameters)


On iPhone 5s

iPhone 5s

On iPhone 6

iPhone 6

Answer

I fixed it by fixing my top view height equals 250, and fix all elements by constraints.

And when I write this code bottom view fixed how I need.

pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0.0, 250.0, self.view.frame.width, self.view.frame.height), pageMenuOptions: parameters)