2

I am using MMDrawerController to show menu in my app - i use one of my ViewControllers for this.

I have problem some problems with constraints. When my menu VC is loaded for the first time - it show all elements in left corner and after second they are placed normally.

So at first time constraints are working only after all UI elements had loaded. What can i do with it?

moonvader
  • 19,761
  • 18
  • 67
  • 116

1 Answers1

3

I have this problem too. I found a (dirty) workaround which consists in calling

[drawerController bouncePreviewForDrawerSide:MMDrawerSideLeft distance:0.1f completion:nil]; // Hack for layout bug in menu

to force the drawer to process its layout.

Quentin Hayot
  • 7,786
  • 6
  • 45
  • 62
  • Are you having this problem when you open menu by sliding or by toggle method? how it can be done in swift? – moonvader May 15 '15 at 14:08
  • I observed that the layout was not correctly rendered before the 2nd opening of the drawer, no matter what method I use. I'm not familiar with swift, but I guess it should work like any other method call. – Quentin Hayot May 15 '15 at 14:12
  • In Swift it looks like centerContainer?.bouncePreviewForDrawerSide(.Left, distance: 0.5, completion: nil) – moonvader Jul 17 '15 at 07:36
  • I too ran into this problem when using MGSlidingTableCell in my Left Side View. This definitely fixed it. I admit, it is dirty, but... unless there is another way to force the controller to process its layout this is harmless. – David Aug 26 '15 at 20:17