IOS Swift: SlidingMenuView incorrect position after imagePicker view

I am using PageMenu in my project in the TabBar controller and navigation controller. When I initialize the β€œscroll menu”, I use it to display it under the status Bar and the navigation bar:

pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0, UIApplication.sharedApplication().statusBarFrame.size.height + self.navigationController!.navigationBar.frame.height, self.view.frame.width, self.view.frame.height), options: parameters) 

This solution works great and displays my menu exactly where I want! Then I present the image selection view inside one of the scrollable views. After rejecting this menu, the menu returns to its original location (under the navigation bar) ...

Any solution to avoid this problem? (If you need more details, I can provide more code)

PS I am not a native speaker of English, so I hope that my question is clear :)

0
ios swift uiimagepickercontroller uinavigationbar presentviewcontroller
Apr 08 '15 at 15:57
source share
3 answers

The viewcontroller "pageMenu" was added as a child of the parent controller, and the problem was resolved.

+2
Jul 27 '15 at 12:31 on
source share

This is in Obj-C, but Swift is the same as I think. In the parent view controller, add pageMenu as the child VC:

 [self addChildViewController:_pageMenu]; 

In the child VC, call picker as follows:

 UIViewController*vc=self.parentViewController.parentViewController; [vc presentViewController:imagePickerController animated:YES completion:nil]; 
0
Oct. 15 '15 at 7:18
source share

the problem is that pageMenu adds to viewDidLoad, and here the view does not have the right measures. Create a container view on the storyboard and add PageMenu to the container. Work with me, although this may not be a good practice.

0
Mar 30 '16 at 17:08
source share



All Articles